Changing Torso Color On Spawn

Hello,

I am working on a simple FPS game and I would like the color of each player’s torso to change when they spawn (the color would depend on whichever team they’re on). Any ideas on where I should start?

I am not sure if this will affect anything, but I should also mention that my game uses R15 player models, as well as a blank StarterCharacter in the StarterPlayer folder.

P.S: I am currently somewhat new to scripting, but I feel like this is a simple enough way to start!

1 Like
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Torso = Character:WaitForChild("Torso", 30)
		wait(1)
		if Torso then
			Torso.Color = Player.TeamColor.Color
		end
	end)
end)
3 Likes

Thank you for the response!

Your script seems to work perfectly for the R6 avatar, but my game is using R15. What should I change for it to work?

You should use UpperTorso.Color = Player.TeamColor.Color and if you want the waist bit it is LowerTorso.Color = Player.TeamColor.Color

1 Like
local list = {"UpperTorso", "Torso", "LowerTorso"}
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		wait(1)
		for i,v in pairs(Character:GetChildren()) do
			if table.find(list, v.Name) then
				v.Color = Player.TeamColor.Color
			end
		end
	end)
end)
1 Like