Skip to content

SetPlayerChatVisible

Shows or hides the chat on a player’s screen.

Hidden, none of the chat’s lines show on the player’s screen and Enter opens no chat box (a box open at that moment closes). Messages still reach them and show again once the chat is back. Use it for a login screen, a cutscene or anything that wants the whole screen. It lasts until you change it or the player leaves; every visit starts with the chat shown. Players can also hide the chat themselves in the launcher’s options - the chat shows only while both allow it, and GetPlayerChatVisible reports your side alone.

SetPlayerChatVisible(pid, visible)
Parameter Type
pid number the player
visible boolean true to show the chat, false to hide it

boolean - false when not connected

-- no chat until the player is in the world
function OnPlayerConnect(pid)
SetPlayerChatVisible(pid, false)
end
function OnPlayerSpawn(pid)
if not GetPlayerChatVisible(pid) then SetPlayerChatVisible(pid, true) end
end

GetPlayerChatVisible · SendClientMessage · the Chat and commands group of the index