I am trying to remove every shirt/pants/hats in a character and change the color of their body. Easy, but the problem is that it does not work. Here's the script:
local player = game.Players.LocalPlayer
local character = player.Character
repeat wait() until character
for i,v in pairs(character:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
wait()
end
if v:IsA("Shirt") then
v:Destroy()
wait()
end
if v:IsA("Pants") then
v:Destroy()
wait()
end
if v:IsA("Part") then
if v.Name == "Torso" then
v.BrickColor = BrickColor.Black()
wait()
end
if v.Name == "Left Arm" then
v.BrickColor = BrickColor.Gray()
wait()
end
if v.Name == "Right Arm" then
v.BrickColor = BrickColor.Gray()
wait()
end
if v.Name == "Right Leg" then
v.BrickColor = BrickColor.Black()
wait()
end
if v.Name == "Left Leg" then
v.BrickColor = BrickColor.Black()
wait()
end
if v.Name == "Head" then
v.BrickColor = BrickColor.Gray()
wait()
end
end
end

1 comment
In studio it works 1/2 of the time and on a server it does not work at all.