EndPlayerSleep
Gets a player lying in a bed up, with the game’s own get-up animation.
Ends any bed’s sleep - one without the wheel, or one with the wheel still up (it closes). OnPlayerSleep says "up"
once they are standing.
Syntax
Section titled “Syntax”EndPlayerSleep(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”true, or false and why: "not sleeping", "not in the world", "their game cannot", "not connected"
Example
Section titled “Example”-- Rest back in real time: one point a second, up at full Restfunction OnTick(dt) for pid in pairs(slept) do local rest, max = GetPlayerEnergy(pid) if rest and rest < max then SetPlayerEnergy(pid, math.min(max, rest + dt)) elseif rest then EndPlayerSleep(pid) end endendSee also
Section titled “See also”SetPlayerSleepWheel · OnPlayerSleep · the Beds and sleep group of the index
