Player class
Part of Limb Damage
Player extensions of the Limbs plugin: shorthands for reading the limb damage of a player on either realm and for hurting, healing and resetting their limbs on the server.
Summary
Methods
Hurts one limb of the player.
get_limb_damage(limb)shared
Returns the damage of one limb of the player.
get_limbs()shared
Returns the damage of every hurt limb of the player.
heal_limb(limb, amount)server
Heals one limb of the player.
heal_limbs(amount)server
Heals every hurt limb of the player by the same amount.
is_limb_damaged(limb)shared
Checks whether a limb of the player is hurt.
reset_limbs()server
Clears the damage of all limbs of the player at once.
Methods
Hurts one limb of the player. Server only.
Parameters
- limb String limb ID
- amount Number damage to add
Returns
- Number the damage that was added
See also
Returns the damage of one limb of the player. On the client only the limbs of the local player are known.
if actor:get_limb_damage('left_leg') > 50 then
actor:notify('my_schema.cannot_climb')
end
Parameters
- limb String limb ID: 'head', 'chest', 'stomach', 'left_arm', 'right_arm', 'left_leg' or 'right_leg'
Returns
- Number damage from 0 (healthy) to 100 (crippled); 0 when limb damage is disabled
See also
Returns the damage of every hurt limb of the player. On the client only the limbs of the local player are known.
Returns
- Map damage (1 to 100) by limb ID, healthy limbs left out
See also
Heals one limb of the player. Server only.
Parameters
- limb String limb ID
- amount Number optional, defaults to
100damage to take off; heals the limb completely when omitted
Returns
- Number the damage that was taken off
See also
Heals every hurt limb of the player by the same amount. Server only.
actor:heal_limbs(25)
Parameters
- amount Number optional, defaults to
100damage to take off each limb; heals the limbs completely when omitted
Returns
- Number the damage that was taken off all limbs together
See also
Checks whether a limb of the player is hurt.
Parameters
- limb String optional, defaults to
nillimb ID; any limb when omitted
Returns
- Boolean
Clears the damage of all limbs of the player at once. Server only.
Returns
- Boolean true if any limb was hurt