Giovany Mito Posted July 6, 2019 Share Posted July 6, 2019 what command do I use to leave the color of the player's name with the same team color? Link to comment
HassoN Posted July 6, 2019 Share Posted July 6, 2019 (edited) Use getPlayerTeam getTeamColor setPlayerNametagColor Edited July 6, 2019 by HassoN Link to comment
Giovany Mito Posted July 6, 2019 Author Share Posted July 6, 2019 setPlayerNametagColor ( getTeamColor ) like this ??? Link to comment
HassoN Posted July 6, 2019 Share Posted July 6, 2019 (edited) Here's an example: -- Server side function fixColors(player) -- making a function local team = getPlayerTeam(player) -- getting player's team if team then -- checking if the player is in a team local r, g, b = getTeamColor(team) -- get the team's color setPlayerNametagColor(player, r, g, b) -- set player color to his team. end -- first if end end -- function end addCommandHandler("fix", fixColors) -- command Edited July 6, 2019 by HassoN Link to comment
Shady1 Posted January 27, 2022 Share Posted January 27, 2022 (edited) hello, if your problem is still valid, I would like to leave this code here, it will be useful for you. if content then if column.name == "name" then r, g, b = getPlayerNametagColor( element ) elseif column.name == "Team" then -- content here is the rank name, set the color how you want it to be. if content == "TEAMNAME" then r = 100 g = 100 b = 255 else r = 255 g = 255 b = 255 end end end @Giovany Mito you can write on the client side of the scoreboard Edited January 27, 2022 by eoL|Shady Link to comment
Moderators turret001 Posted January 27, 2022 Moderators Share Posted January 27, 2022 12 minutes ago, eoL|Shady said: hello, if your problem is still valid, I would like to leave this code here, it will be useful for you. if content then if column.name == "name" then r, g, b = getPlayerNametagColor( element ) elseif column.name == "Team" then -- content here is the rank name, set the color how you want it to be. if content == "TEAMNAME" then r = 100 g = 100 b = 255 else r = 255 g = 255 b = 255 end end end @Giovany Mito you can write on the client side of the scoreboard Please don't bump old topics and stick to new ones. Link to comment
Recommended Posts