Skip to main content

onChat

This event is triggered when a player sends a message to the chat.

Parameters

NameTypeDescription
textstringThe message sent to the chat including commands
playerIdnumberPlayer 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