- Documentation
- Server functions
- setPlayerNametagColor
Function
setPlayerNametagColor
Sets the colour of the nametag above the player's head (everyone sees it; it takes precedence over the colour from setPlayerNametagStyle). The player's nickname in chat uses this colour too.
Syntax
bool setPlayerNametagColor(player thePlayer, int/false r, int g, int b)Arguments
thePlayerplayer- The player.
rint/false- Red 0-255, or
false= the default colour (fromsetPlayerNametagStyle, otherwise the built-in one). gint- Green 0-255.
bint- Blue 0-255.
Returns
true on success.
Example
addEventHandler("onPlayerTeamChange", root, function(oldTeam, newTeam)
if newTeam then
setPlayerNametagColor(source, getTeamColor(newTeam))
end
end)