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.
Syntax
Section titled “Syntax”SetPlayerChatVisible(pid, visible)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
visible |
boolean | true to show the chat, false to hide it |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”-- no chat until the player is in the worldfunction OnPlayerConnect(pid) SetPlayerChatVisible(pid, false)end
function OnPlayerSpawn(pid) if not GetPlayerChatVisible(pid) then SetPlayerChatVisible(pid, true) endendSee also
Section titled “See also”GetPlayerChatVisible · SendClientMessage · the Chat and commands group of the index
