- Documentation
- Server events
- onChatMessage
Event
onChatMessage
A message is going to chat (from a player or a script). You can hold it back.
Handler
addEventHandler("onChatMessage", root, function(theMessage, theElement) ... end)Parameters
theMessagestring- The message.
theElementelement- The sender or a resource.
Source
source is the message source or root.
cancelEvent() holds the message back.
Example
addEventHandler("onChatMessage", root, function(message)
outputServerLog("[czat] " .. message)
end)