Other great resources: Official JS API docs, Scripting Forum
eventChat()
- Aubergine
Owned by Aubergine
This event is triggered each time a chat message is received.
Â
Syntax
function eventChat(sender, to, message) { // do stuff }
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
sender | Number | The id of the player who sent the message | |
to | Number | The id of the player who received the message. This will likely always be the same player as your script, eg. me, but might be one of the Player Scope constants in future releases. | |
message | String | The message that was sent |
Return value
Warzone does not process the event handler return value currently.
However, there is some discussion about using the return value of the handler to control whether a chat message is echoed to the user's console.
Example
Reply to the person who sent the message
function eventChat(sender, to, message) { chat(sender, "I am a plasma cannon viper wheels, your argument is invalid"); }Â
Availability BETA?
Requires:
- Warzone 3.2 and above.
Contents
Jump to:
See also
Related API features:
- Player Scope – constants relating to chat messages
- chat() – send chat messages
- console() – send a message to the script's player console
- debug() – send a message to the terminal or logs
Â