Skip to Content
ResourcesChatEventschat:addMessage

Triggering this event sends a chat message to the client it runs on. It’s the event-based equivalent of the addMessage export, useful when you’re already in a client script and don’t need the export indirection.

Event Name

chat:addMessage

Parameters

  • object message: The message to display
    • template (optional): ID of a template registered with chat:addTemplate
    • color (optional): {r, g, b} array for the message color
    • multiline (optional): Whether the message can wrap across multiple lines
    • args: Array of strings substituted into the message, typically {author, text}

Example

TriggerEvent('chat:addMessage', { color = { 255, 0, 0 }, multiline = true, args = { 'Me', 'Please be careful to not step on too many snails!' } })