Using this export allows you to add a message to the local players chat.
Message object structure:
message = {
template = template,
color = color,
multiline = true,
args = {author, otherArgs...}
}
addMessage
object/string message
This example sends a chat message to a player locally from a client script (only the executing client will see it).
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)
Output: