Skip to content

ChatMessageEvent

Represents an event triggered when a player sends a chat message, containing details about the sender and message content. This event can be canceled to prevent the message from being distributed.

Example: Suppressing chat messages from a specific player

local i = spell:intercept({ "ChatMessageEvent" }, function(evt)
  if evt.sender.name == "mickkay" then
    return false -- cancel the event
  end
end)

while true do sleep(20) end -- Keep the spell active

Fields

message: string Read-Only

The content of the chat message.

name: string Read-Only

The name of the event, identifying it as a chat message event.

sender: Player Read-Only

A reference to the player who sent the chat message.