I'm struggling hard at this because I can't know for sure if it gets deleted or not. Sometimes it does, sometimes it don't. Can someone give me a tip about this?
My current script:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) wait(0.5) for i, v in pairs (char:GetChildren()) do if v.ClassName == 'Accessory' then v:Destroy() end if v.ClassName == 'Hat' then v:Destroy() end end end) end)
Instead of hoping that all the accessories get loaded at a certain time, look up any items added to the player that is an accessory.
plr.CharacterAdded:Connect(function(char) for i, v in pairs (char:GetChildren()) do if v.ClassName == 'Accessory' or v.ClassName == "Hat" then v:Destroy() end char.ChildAdded:Connect(function(child) if child.ClassName == "Accessory" or child.ClassName == "Hat" then child:Destroy() end end) end end)