i've tried
plr.Character.ChildAdded:connect(function(child) if child.ClassName == "Hat" then repeat wait() until child.Handle child:Destroy() end end)
and it works mostly but sometimes it doesnt
I'd use this code, it may not work, but I tried:
game.Workspace.ChildAdded:connect(function(plr) local name = plr.Name local playerinplayers = game.Players:FindFirstChild(plr.Name) playerinplayers.CanLoadCharacterAppearance = false for i,v in pairs(plr:GetChildren()) do if v:IsA("Hat") then v:Destroy() end end end)