Attributes

Hook Documentation for Attributes Module.

Functions

MODULE:AdjustStaminaOffset(client, offset)

Adjusts the stamina offset otherwise. This hook can be used to apply additional modifications to the stamina offset, whether the player is running or regenerating stamina.

Parameters

  • client Player

    The player whose stamina is being adjusted.

  • offset Float

    The current stamina offset.

Returns

  • number

    The modified stamina offset.

MODULE:AdjustStaminaOffsetRunning(client, offset)

Adjusts the stamina offset when a player is running. This hook can be used to modify the stamina consumption rate while the player is running.

Parameters

  • client Player

    The player who is running.

  • offset Float

    The current stamina offset.

Returns

  • number

    The modified stamina offset.

MODULE:AdjustStaminaRegeneration(client, offset)

Adjusts the stamina regeneration rate. This hook can be used to modify the rate at which a player regenerates stamina.

Parameters

  • client Player

    The player whose stamina is regenerating.

  • offset Float

    The current stamina regeneration offset.

Returns

  • number

    The modified stamina regeneration offset.

MODULE:CalcStaminaChange(client)

Called to calculate the change in a player's stamina. This function determines the change in stamina based on the player's actions, such as running or regenerating stamina.

Parameters

  • client Player

    The player whose stamina is being calculated.

Returns

  • number

    The change in stamina, which can be positive (regeneration) or negative (consumption).

MODULE:CanPlayerThrowPunch(client)

Determines if a player can throw a punch.

Parameters

  • client Player

    The player attempting to throw a punch.

Returns

  • True

    if the player can throw a punch, false otherwise.

MODULE:CanPlayerViewAttributes(client)

Determines if a player can view their attributes. This hook is used to check if a player is allowed to view their attributes.

Parameters

  • client Player

    The player attempting to view attributes.

Returns

  • bool

    True if the player can view attributes, false otherwise.

MODULE:CharMaxStamina(character)

Determines the maximum stamina for a character. This hook is used to get the maximum stamina value for a character.

Parameters

  • character Character

    The character whose maximum stamina is being determined.

Returns

  • number

    The maximum stamina value for the character.

MODULE:GetStartAttribPoints(client, context)

Retrieves the starting attribute points for a player. This hook is used to determine the initial number of attribute points a player starts with.

Parameters

  • client Player

    The player whose starting attribute points are being determined.

  • context Table

    The context in which the starting attribute points are being determined.

Returns

  • number

    The number of starting attribute points.

MODULE:OnCharAttribBoosted(client, character, key, value)

Called when a character's attribute is updated.

Parameters

  • client Player

    The client associated with the character.

  • character Character

    The character whose attribute is updated.

  • key String

    The key of the attribute being updated.

  • value Integer

    The new value of the attribute.

MODULE:PlayerCanPickupItem(client, item)

Determines if a player can pick up an item with his hands. This hook is used to check if a player is allowed to pick up a specific item.

Parameters

  • client Player

    The player attempting to pick up the item.

  • item Item

    The item being picked up.

Returns

  • bool

    True if the player can pick up the item, false otherwise.

MODULE:PlayerStaminaGained(client)

Called when a player gains stamina.

Parameters

  • client Player

    The player who gained stamina.

MODULE:PlayerStaminaLost(client)

Called when a player loses stamina.

Parameters

  • client Player

    The player who lost stamina.