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

How do you remove a hat from a player?

Now, It's a simple question. I just need help how to.

2 answers

✓ Accepted answer

What Shawnyg said should work.

I'll give you another way to do what you want to do.





function removehats()
	for i, v in pairs(game.Players:GetChildren()) do
		wait()
		for i, t in pairs(v.Character:GetChildren()) do
			if t:IsA("Hat") then
				t:Destroy()
			end
		end
	end
end





while true do
	wait(2)
	removehats()
end




I apologize for the spacing as I just did this without studio

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Hat") then
v:Destroy()
end
end
end)
end)

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