I tried findfirstchild waitforchild its so annoying please help I want the players hat to be destroyed when they join.
If you want all the hats a player has to be destroyed everytime they respawn, then instead of using waitforchild or findfirstchild, you should use the PlayerAdded event and CharacterAdded event to search through the entire character for hats using the :IsA() method and then destroy the hat.
local players = game:GetService'Players' -- Get the players service players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) --This event will fire whenever the character is spawned wait(.8) -- Hats take a few second to load for i,v in next,c:GetChildren() do --Search through the entire character if v:IsA("Hat") then -- Check if v is a hat v:Destroy() --Destroy the hat end end end) end)