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!
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)
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)