I had a hat remover working in my game but when I changed it to R6, the hat remover stopped working so I tried to make a new one but nothing seemed to work. Can someone help me by pointing out what I've done wrong? There are no errors in the output bar.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) local c = char:GetChildren() if c.ClassName == "Accessory" then c:Destroy() c:Remove() end end) end)
You didn't enumerate through the assets of the Character, meaning you couldn't locate every Accessory to properly remove them. You also tried to call methods of Instance on an array, as :GetChildren()
return a table.
local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) local Accessories = Character:GetChildren() for _,Accessory in pairs(Accessories) do if (Accessory:IsA("Accessory")) then Accessory:Destroy() end end end) end)