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.
Returns the damage of one limb of the player.
Returns the damage of every hurt limb of the player.
Heals one limb of the player.
Heals every hurt limb of the player by the same amount.
Checks whether a limb of the player is hurt.
Clears the damage of all limbs of the player at once.

Methods

Player:damage_limb(limb, amount)

server plugins/limbs/plugin/lib/meta/sh_player.lua:47

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

Player:get_limb_damage(limb)

shared plugins/limbs/plugin/lib/meta/sh_player.lua:18

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

Player:heal_limb(limb, amount)

server plugins/limbs/plugin/lib/meta/sh_player.lua:56

Heals one limb of the player. Server only.

Parameters

  • limb String limb ID
  • amount Number optional, defaults to 100 damage to take off; heals the limb completely when omitted

Returns

  • Number the damage that was taken off

See also

Player:heal_limbs(amount)

server plugins/limbs/plugin/lib/meta/sh_player.lua:68

Heals every hurt limb of the player by the same amount. Server only.

actor:heal_limbs(25)

Parameters

  • amount Number optional, defaults to 100 damage to take off each limb; heals the limbs completely when omitted

Returns

  • Number the damage that was taken off all limbs together

See also

Player:is_limb_damaged(limb)

shared plugins/limbs/plugin/lib/meta/sh_player.lua:33

Checks whether a limb of the player is hurt.

Parameters

  • limb String optional, defaults to nil limb 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

See also

Defined in