Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I remove all hats?

I know it would be something along the lines of this:

game.Players.PlayerAdded:connect(function(plr)
wait(5)
for k, p in pairs(plr.Character:GetChildren()) do
if p.ClassName=="Hat" then
p:Destroy()
end
end
end)

1 answer

Removes all hats in Workspace.

Workspace.DescendantAdded:connect(function(obj)
if obj:IsA("Hat") then wait()
obj:Destroy()
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.