ClearChatBox: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Zbigniewqq (talk | contribs) m (→Example) |
||
Line 27: | Line 27: | ||
This example removes spam caused by outputChatBox | This example removes spam caused by outputChatBox | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
for i=1,10 do | for i=1,10 do | ||
outputChatBox( "spam ..." ) | outputChatBox( "spam ..." ) | ||
Line 34: | Line 33: | ||
clearChatBox() | clearChatBox() | ||
outputChatBox("Chat cleared successfully!") | outputChatBox("Chat cleared successfully!") | ||
</syntaxhighlight> | |||
</section> | |||
==Example== | |||
<section name="Server" class="server" show="false"> | |||
This example deletes messages for all players | |||
<syntaxhighlight lang="lua"> | |||
local players = getElementsByType('player') | |||
for k, v in pairs(players) do | |||
clearChatBox(v) | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 14:44, 6 August 2019
This function clears the chatbox. It does not clear the console (F8)
Syntax
Click to collapse [-]
Clientbool clearChatBox ()
Returns
Returns true if the player's chat was cleared successfully, false otherwise.
Click to collapse [-]
Serverbool clearChatBox ( [ element clearFor = getRootElement() ])
Required Arguments
- clearFor : The player whose chat is to be cleared. By default, this is set to the root element, which will affect all players.
Returns
Returns true if the player's chat was cleared successfully, false otherwise.
Example
Click to collapse [-]
ClientThis example removes spam caused by outputChatBox
for i=1,10 do outputChatBox( "spam ..." ) end clearChatBox() outputChatBox("Chat cleared successfully!")
Example
Click to expand [+]
ServerSee Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown