I'm making a script to change the player's Torso color when they change teams, but its not changing the color. Referencing the Player itself in the Workspace doesn't work either. Idk. Its making me very confused though.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) wait(1) local newPlayer = player.Team local pTeam = game.Teams if newPlayer == pTeam.pesant then character.Torso.BrickColor = BrickColor.new("Reddish brown") end if newPlayer == pTeam.civilain then character.Torso.BrickColor = BrickColor.new("Cork") end if newPlayer == pTeam.gaurd then character.Torso.BrickColor = BrickColor.new("Storm blue") end if newPlayer == pTeam.knigt then character.Torso.BrickColor = BrickColor.new("Pearl") end if newPlayer == pTeam["knigt brigader"] then character.Torso.BrickColor = BrickColor.new("Sand green") end if newPlayer == pTeam["knigt comandor"] then character.Torso.BrickColor = BrickColor.new("Bright blue") end if newPlayer == pTeam["knigt king"] then character.Torso.BrickColor = BrickColor.new("Cyan") end if newPlayer == pTeam.roug then character.Torso.BrickColor = BrickColor.new("Sea green") end if newPlayer == pTeam.viking then character.Torso.BrickColor = BrickColor.new("Persimmon") end if newPlayer == pTeam["viking chieftan"] then character.Torso.BrickColor = BrickColor.new("Bright red") end if newPlayer == pTeam["viking king"] then character.Torso.BrickColor = BrickColor.new("Maroon") end end) end)
(And yes i'm aware the Teams are the similar to the 'prtty much evry bordr gam ever' game.)
Any Ideas?
game.Players.PlayerAdded:Connect(function(player) player:GetPropertyChangedSignal("Team"):Connect(function() local character = player.Character if character and character:FindFirstChild("Body Colors") then character["Body Colors"].TorsoColor = player.Team.TeamColor end end) player.CharacterAppearanceLoaded:Connect(function(character) character["Body Colors"].TorsoColor = player.Team.TeamColor end) end)