Skip to content

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.

SetPlayerHealth(pid, health)
Parameter Type
pid number the player
health number the new health

boolean - false when not connected

-- /slap <name>: a nudge
SetPlayerHealth(target, GetPlayerHealth(target) - 10)

GetPlayerHealth · HealPlayer · OnPlayerDeath · the Vitals, stats and skills group of the index