I wrote a script that tries to make a player's TorsoColor the same as their TeamColor but it doesn't work.
local players = game:GetService("Players")
players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
while true do
local TorsoColor = char['Body Colors'].TorsoColor
local TeamColor = p.TeamColor
TorsoColor = TeamColor
print(TorsoColor)
wait(1)
print(TeamColor)
end
end)
end)
- The StarterCharacter I have has all Body Colors as White.
- The starting TeamColor is Blue.
- Both the output of print(TeamColor) and print(TorsoColor) is Blue.
- Changing teams does not change the output of print(TeamColor) and print(TorsoColor).
- The color of my player's Torso is still White regardless of what team I'm on.
Does anyone know what the problem is?

2 comments
instead of a local variable for torsocolor, try just setting char['BodyColors'].TorsoColor = p.TeamColor since the TorsoColor is a Property, also any shirt or pants templates will override the body appearance
I tried doing that first but it didn't work either, also, the StarterCharacter I have for the players doesn't have any clothing.