I made a script so that when a player enters, its hats will be deleted. Here is the script:
game.Players.PlayerAdded:Connect(function(player)
local char = player.Character
if char then
local count = char:GetChildren()
for i = 1, #count do
if (count[i].className == "Accessory") then
count[i]:Destroy()
end
end
end
end)
Also, click me to see where the script is in.
Hope someone can help me fix the problem!

1 comment
Hi, thanks to those people who gave upvotes! :)