[HELP] Colors in lua scripting

How can I assign colors in the “User” and “Admin” lines?
I tried to put (~ r ~, ~ s ~, ~ u ~) colors but they did not work.

– Hooking into chat messages to insert admin tags.
AddEventHandler(‘chatMessageEntered’, function(name, color, message)
CancelEvent()

local tag = "^whiteUser ^black| ^gray"

if(Users[source] ~= nil)then
	if(tonumber(Users[source].admin) > 0)then
		tag = "^redAdmin ^black| ^gray"
	end
end

TriggerEvent('chatMessage', source, tag .. GetPlayerName(source), message)

TriggerClientEvent('chatMessage', -1, tag .. GetPlayerName(source), {0, 0x99, 255}, message)

print(GetPlayerName(source) .. ': ' .. message)

end)

Use the color codes ^1 - ^9

I tested those color codes and black, white and gray does not work. Any ideas on how to fix it.

1 Like