game.Players.PlayerAdded:connect(function(plr) for i,v in pairs(plr.Character:GetChildren())do if v.ClassName == "Hat" or v.ClassName == "Accountrement" then v:Destroy() end end end)
i am trying to make a script that deletes all the hat player has when he joins the game but this script will not work please help.
The hat class has been replaced with the Accessory class. You also spelled Accoutrement wrong.
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(character) for i,v in pairs(character:GetChildren())do if v.ClassName == "Accoutrement" then v:Destroy() end end end) end)