Script won't work

I’m trying to make a script that changes your avatar’s torso color when you’re on different teams, for example if I’m on red team I would have a bright red torso color and my friend that is on blue team would have a Electric blue torso color but the script I made isn’t working:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.Team == game.Teams["Blu taeam"] then
				character:WaitForChild("Torso").BrickColor = BrickColor.new("Electric blue")
		elseif player.Team == game.Teams["Red taeam"] then
				character:WaitForChild("Torso").BrickColor = BrickColor.new("Bright red")
		elseif player.Team == game.Teams["Chowsing taeam"] then
				character:WaitForChild("Torso").BrickColor = BrickColor.new("Fossil")
		end
	end)
end)
2 Likes

Maybe wait one second before changing the color, because the body color might override you changing it. He just spawned, and the bodycolors take some time to load.

2 Likes

Is there any clothing over the player’s torso, or anything like that?

Additionally, can you try printing something before the torso color gets changed and see if anything prints?

1 Like

I would change the torso for each person when they join the team, so you could set it up like:

game.Teams["Blue Team"].PlayerAdded:Connect(function(player)
    player.Character:WaitForChild("Torso").BrickColor = BrickColor.new("Electric blue")
    print("Color Changed")
end)

Also make sure you spell things correctly, not sure if the team names were spelled correctly or not, but I don’t know what you exactly named them. Also remember what GalaxyGourmet said, clothing could be over the players torso, so it would be good to print something in there just to make sure your code works.

1 Like

No, the default character does not have any kind of shirt and yes I might try that

Okay, I’ll try that and also the things I didn’t spell like teams names correctly is on purpose but I made sure that everything outside the names was correctly spelt.

Could it be because you have R15 enabled instead of R6?

R15 has UpperTorso and LowerTorso instead of just Torso

1 Like

It’s R6 but thank you for trying to help anyways.

Thank you very much for the help, this worked.

1 Like