setTeamColor
Server-only function
https://wiki.multitheftauto.com/wiki/SetTeamColor
to fix it use
https://wiki.multitheftauto.com/wiki/TriggerServerEvent
server file
function changeclr ( tesm,r,g,b )
setTeamColor ( team,r,g,b )end
addEvent( "changeclr", true )
addEventHandler( "changeclr", resourceRoot,changeclr )
client
your full code
+
function updateTeamColour()
triggerServerEvent ( "changeclr", resourceRoot,team[2], colour.r, colour.g, colour.b )
end
addEventHandler("onClientPlayerJoin", getRootElement(), updateTeamColour)