ok, try this,
onPlayerChat Part:
local r,g,b
function setPlayerChatColor(message, messageType)
if (messageType == 0) then
local thePlayer = getPlayerName(source)
cancelEvent()
if (getPlayerTeam(source) == usteam) then
if data == (usteam) then
r,g,b = 2,134,183
end
outputChatBox(thePlayer.. '#1569C7[M] : #ffffff' ..tostring(message),getRootElement(),r,g,b,true)
elseif (getPlayerTeam(source) == doteam) then
if data == (doteam) then
r,g,b = 100,255,100
end
local r,g,b = getTeamColor(doteam)
outputChatBox(thePlayer.. '#aaff00[Donator] : #ffffff' ..tostring(message),getRootElement(),r,g,b,true)
elseif not(getPlayerTeam(source) == usteam) and not(getPlayerTeam(source) == doteam) then
local team = getPlayerTeam(source)
if data == (team) then
r,g,b = 255,255,255
end
outputChatBox(thePlayer.. ': #FFFFFF' ..tostring(message),getRootElement(),r,g,b,true)
end
end
end
addEventHandler( "onPlayerChat", getRootElement(), setPlayerChatColor )