SetPlayerHealth
Sets the player’s health; 0 kills.
Clamped to 0 .. max; the player’s client shows the new value. 0 kills the player at once - OnPlayerDeath with
attacker -1, the respawn after [combat] respawn_seconds. A dead player’s health stays 0 until they respawn; use
HealPlayer or SpawnPlayer to bring one back.
Syntax
Section titled “Syntax”SetPlayerHealth(pid, health)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
health |
number | the new health |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”-- /slap <name>: a nudgeSetPlayerHealth(target, GetPlayerHealth(target) - 10)See also
Section titled “See also”GetPlayerHealth · HealPlayer · OnPlayerDeath · the Vitals, stats and skills group of the index
