Skip to content

TogglePlayerControllable

Holds or releases the player’s keyboard.

false freezes the player where they stand: the keyboard does nothing on their client, the mouse still looks around, T and Enter still open the chat. true gives the keyboard back. The server’s own login hold uses the same lever for a registered name until its /login.

TogglePlayerControllable(pid, controllable)
Parameter Type
pid number the player
controllable boolean false holds, true releases

boolean - false when not connected

-- freeze everyone for the countdown
for _, pid in ipairs(GetPlayers()) do TogglePlayerControllable(pid, false) end
SetTimer(function()
for _, pid in ipairs(GetPlayers()) do TogglePlayerControllable(pid, true) end
GameTextForAll("Go!", 1500)
end, 3000)

IsPlayerControllable · SetPlayerVirtualWorld · the Players group of the index