Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Hat remover script not removing hats why?

Asked by
MHaven1 159
8 years ago
1game.Players.PlayerAdded:connect(function(plr)
2    for i,v in pairs(plr.Character:GetChildren())do
3        if v.ClassName == "Hat" or v.ClassName == "Accountrement" then
4            v:Destroy()
5        end
6    end
7end)

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.

1 answer

Log in to vote
2
Answered by 8 years ago
Edited 8 years ago

The hat class has been replaced with the Accessory class. You also spelled Accoutrement wrong.

1game.Players.PlayerAdded:connect(function(plr)
2    plr.CharacterAdded:connect(function(character)
3        for i,v in pairs(character:GetChildren())do
4            if v.ClassName == "Accoutrement" then
5                v:Destroy()
6            end
7        end
8    end)
9end)
Ad

Answer this question