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

How would I remove all hats?

Asked by 10 years ago

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

Log in to vote
0
Answered by
Dummiez 360 Moderation Voter
10 years ago

Removes all hats in Workspace.

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

Answer this question