Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Player's torso will not change colors, could anybody help?

I tried to make a script that would change a player's torso based off of a player's team. But it would not work. First, I placed the script as a local script into the starter player, then I changed the entire script and made it into a regular script that didn't work out, so I took the script and placed it into the server script service, and it still, will not work. Help please. Here's my script.




game.Players.PlayerAdded:Connect(function(player)
	local team = player.Team
	local char = player.Character or player.CharacterAdded:Wait()
	local torso = char.Torso
	torso.BrickColor = team.TeamColor
	team:GetPropertyChangedSignal("TeamColor"):connect(function()
		torso.BrickColor = team.TeamColor
	end)
end)



4 comments

0

is it r6 or r15?

0

r6

0

You can just check if it is R6 or R15 by using a function that checks BodyType in Humanoid

0

I am not looking to change the body type, I am trying to change the torso color. I have the game's settings so it is only R6.

1 answer

✓ Accepted answer

Use Body Colors:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        repeat wait() until player.Team
        local team = player.Team

        local bodyColors = character:WaitForChild("Body Colors")
        bodyColors.TorsoColor = team.TeamColor


        player:GetPropertyChangedSignal("Team"):Connect(function()
			bodyColors = character["Body Colors"]
			team = player.Team
			
			bodyColors.TorsoColor = player.Team.TeamColor
         end)
    end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.