SetPlayerHealth
Jump to navigation
Jump to search
setPlayerHealth
Sets a player's authoritative current health value.
Syntax
bool setPlayerHealth(int playerId, number value)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to update. |
value |
number |
yes | The new current health value. |
Returns
Returns true when the value is accepted; otherwise returns false.
Examples
Set a player's current health:
setPlayerHealth(playerId, 50)
Notes
- Available only in server-side resource scripts.
- This is a convenience wrapper around
setPlayerStat(playerId, "health", value).