Script:
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(chr) wait() local d = chr:FindFirstChild("Hat") for i,v in pairs(d) do v:Destroy() end end) end)
It isn't working because it is looking for a child inside the players character that is called "hat". Try this instead:
while wait() do for i,v in pairs(game.Players:GetPlayers()) do if workspace:FindFirstChild(v.Name) then local char = workspace:WaitForChild(v.Name) for i,v in pairs(char:GetChildren()) do if v.ClassName == "Hat" then v:Destroy() end end end end end