(info) Other great resources: Official JS API docs, Scripting Forum

eventChat()

This event is triggered each time a chat message is received.

 

Syntax

function eventChat(sender, to, message) {
  // do stuff
}

Parameters

ParameterTypeMandatoryDescription
senderNumber(tick)The id of the player who sent the message
toNumber(tick)

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.

messageString(tick)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