Hello, I am coding for when the team changed the icon will change too but it didn’t change.
Here is my code: (Server side)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Team")
local NameDisplay = script:WaitForChild("NameDisplay")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local clone = NameDisplay:Clone()
local PlrHead = char:WaitForChild("Head")
clone.Parent = PlrHead
clone:WaitForChild("Username"):WaitForChild("UsernameLabel").Text = player.Name
clone:WaitForChild("Username"):WaitForChild("UsernameLabel").TextColor = BrickColor.new("Deep orange")
clone:WaitForChild("Username"):WaitForChild("ShadowLabel").Text = player.Name
clone:WaitForChild("Team"):WaitForChild("TeamHold"):WaitForChild("TeamLabel").Text = player.Team.Name
clone:WaitForChild("Team"):WaitForChild("TeamHold"):WaitForChild("TeamLabel").TextColor = BrickColor.new("Deep orange")
end)
end)
RemoteEvent.OnServerEvent:Connect(function(Player, teamName)
local Char = Player.Character
local Username = Char:FindFirstChild("Head"):FindFirstChild("NameDisplay"):FindFirstChild("Username"):FindFirstChild("UsernameLabel")
local TeamLabel = Char:FindFirstChild("Head"):FindFirstChild("NameDisplay"):FindFirstChild("Team"):FindFirstChild("TeamHold"):FindFirstChild("TeamLabel")
local Icons = Char:FindFirstChild("Head"):FindFirstChild("NameDisplay"):FindFirstChild("Icons"):FindFirstChild("ImageLabel")
if teamName == "Engineering Department" then
Player.TeamColor = BrickColor.new("New Yeller")
TeamLabel.Text = "Engineering Department"
Username.TextColor = BrickColor.new("New Yeller")
TeamLabel.TextColor = BrickColor.new("New Yeller")
Icons.Image = "rbxassetid://14379366079"
Player:LoadCharacter()
end
end)
https://gyazo.com/a5cac62fa6d9fa91ffb8de75f0a5a317
You may see on the video that an orange icon was not change
Thanks!