SetPlayerEnergy
Sets how rested the player’s character is.
value is 0 or more, clamped to the maximum once the server knows it (GetPlayerEnergy gives both) - and, under
[audit] mode = "enforce", to the game’s own maximum of 100 whatever their game reported (observe leaves the mode’s own
value as it is); the game runs it on from there. A set of the mode’s own voids the energy check’s stretch of judging for that
value, so setting it never reads as a trainer. Called before the player is in the world, it is applied right after their
spawn.
Syntax
Section titled “Syntax”SetPlayerEnergy(pid, value)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
value |
number | the energy, 0 or more |
Returns
Section titled “Returns”boolean - false for a value below 0 or not a number, or a player not connected
Example
Section titled “Example”-- a night in the inn's bedlocal _, max = GetPlayerEnergy(pid)if max and max > 0 then SetPlayerEnergy(pid, max) endSee also
Section titled “See also”GetPlayerEnergy · SetPlayerNourishment · the Stats, skills, XP and perks group of the index
