onChat
This event is triggered when a player sends a message to the chat.
Parameters
Name | Type | Description |
---|---|---|
text | string | The message sent to the chat including commands |
playerId | number | Player Id of the player who sent the message |
Example
engine.events.on('onChat', (text, playerId) => {
console.log(`message`, text, 'from', playerId);
});
Available on: Client Websocket Server