This server export adds a message to a target player’s chat, or to every
connected player’s chat when target is -1. It’s the standard way for a
server-side script to send system messages, announcements, or command
feedback without routing through the deprecated chatMessage event.
Export Name
addMessageParameters
- int target: The player server ID to message, or
-1to broadcast to everyone - object|string message: Same shape as the
chat:addMessagemessage
Example
AddEventHandler('onResourceStart', function(resourceName)
if GetCurrentResourceName() ~= resourceName then return end
exports.chat:addMessage(-1, {
color = { 255, 0, 0 },
args = { 'SYSTEM', string.format('%s has started.', resourceName) }
})
end)