Skip to Content
ResourcesChatExportsaddMessage (client)

This client export adds a message to the chat of the resource that calls it. It behaves the same as triggering chat:addMessage, but reads better when you’re already calling into the chat resource through exports rather than raising events.

Export Name

addMessage

Parameters

  • object|string message: Same shape as the chat:addMessage message, with template, color, multiline, and args fields

Example

AddEventHandler('onResourceStart', function(resourceName) if GetCurrentResourceName() ~= resourceName then return end exports.chat:addMessage({ color = { 255, 0, 0 }, args = { 'SYSTEM', string.format('%s has started.', resourceName) } }) end)