An issue has cropped up in regards to icons next to player names… As each time you switch teams, all players will have the icon of your team, but on their end they won’t see any icons. As shown below
My client
Another player’s client
How would I go about making sure that players can see the proper icons, and the icons don’t replicate to users that shouldn’t have the icons in the first place.
Icon script
localPlayer:GetPropertyChangedSignal("Team"):Connect(function()
for i, value in pairs(TeamArray) do
if localPlayer.TeamColor == TeamArray[1] then
Icon.Active = true
Icon.Image = iconImageArray[1]
elseif localPlayer.TeamColor == TeamArray[2] then
Icon.Active = true
Icon.Image = iconImageArray[2]
elseif localPlayer.TeamColor == TeamArray[3] then
Icon.Active = true
Icon.Image = iconImageArray[3]
elseif localPlayer.TeamColor == TeamArray[4] then
Icon.Active = true
Icon.Image = iconImageArray[4]
elseif localPlayer.TeamColor == TeamArray[5] then
Icon.Active = true
Icon.Image = iconImageArray[5]
end
end
refresh()
end)
Arrays needed
local iconImageArray = {
"rbxassetid://18413761813",
"rbxassetid://18413212927",
"rbxassetid://18413991987",
"rbxassetid://18414227286",
"rbxassetid://18414094164"}
local TeamArray = {
BrickColor.new("Royal purple"),
BrickColor.new("Bright red"),
BrickColor.new("Dark green"),
BrickColor.new("White"),
BrickColor.new("Electric blue"),
BrickColor.new("Black"),}