Server script in serverscriptservice
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
--remove clothes
for i, child in pairs(char:GetDescendants()) do
if child:IsA("Shirt") or child:IsA("ShirtGraphic") or child:IsA("Pants") then
child:Destroy()
end
--also, destroy any accessories that arent hair or hats
if child:IsA("Accessory") then
if child.AccessoryType ~= Enum.AccessoryType.Hat and child.AccessoryType ~= Enum.AccessoryType.Hair then
child:Destroy()
end
end
end
end)
end)
My goal is to remove clothes (so I can add custom ones) as well as destroy any accessories that aren’t hats or hair.
This does not work. At all. I don’t know why, my only idea is that maybe it’s because the player hasn’t fully loaded in when it searches for accessories to destroy? If that is the case, how do I fix it? if it isn’t what do I do?