OutputConsole
Jump to navigation
Jump to search
This outputs the specified text string to the console window (accessed with F8 or ~ key). It can be specified as a message to certain player(s) or all players.
Syntax
bool outputConsole ( string text, element visibleTo=getrootelement() )
Required Arguments
- text: The text string that you wish to send to the console window
Optional Arguments
- visibleTo: This specifies who the chat is visible to. Any players in this element will see the chat message. See visibility.
Example
root = getRootElement () addEventHandler ( "onPlayerConsole", root, "onConsole" ) function onConsole ( message ) local command = gettok(message, 1, 32) --The varible "command" equals text a player types in the console if (command == "!public") then --If players typed text equals !public outputChatBox ( "Public console message" ) --Display console message to all players elseif (command == "!private") then --If players typed text equals !private outputChatBox ( "Private console message", source ) --Send message to whoever entered the text !private end end