Other great resources: Official JS API docs, Scripting Forum
console()
Outputs text to the player console associated with the script.
Syntax
console(text[, text[, ...]]);Parameters
Parameter | Type | Mandatory | Description | Game version |
|---|---|---|---|---|
text | String | The text to output to the console. If you pass multiple parameters, each string will be output on a new line. Maximum 255 characters per string. | 3.1 Beta 1 |
Return values
Value | Type | Description | Game version |
|---|---|---|---|
| Undefined | No errors occurred, so if the human was watching your script's player then they will have seen the text in the console. | 3.1 Beta 1 |
<error> | Error | I assume an error will be thrown if something went wrong deeper in the C++ code. | 3.1 Beta 1 |
Example
Put some text in the console
console("Greetings Commander,", "Welcome to Warzone!");Notes
The following characters are silently removed from strings output to the console: @
If you specify a string greater than 255 characters long, only the first 255 characters will be output – the rest will be silently discarded.