So basically, I have this team hat script. The script itself works fine except for one part-- the original hats the player has do not get removed when they select a team, and get a hat.
Here is the portion of the code that should remove a player's existing hats
game.Players.PlayerAdded:connect(function(Plr) Plr.CharacterAdded:connect(function(Char) wait(0.5) -- Wait so that the hats load local Contents = Char:GetChildren() for _, v in pairs(Contents) do -- Remove all existing hats to add new one(s) if v:IsA("Hat") then v:Destroy()
Hats have been changed to "Accessory". Use that instead.
-wiki http://wiki.roblox.com/index.php?title=API:Class/Accessory