Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to remove all the players accessorys?

Asked by 5 years ago

I am trying to make a script that turns the player invisible but the accessories will not go away.

I have tried multiple things but 90% of the time it won't work and 10% it will work.

wait(0.1)
    for k, v2 in pairs(char:GetDescendants()) do
        if v2:IsA("BasePart") or v2:IsA("Decal") then
            v2.Transparency = 1
        end
    end
    for i,v in pairs(char:GetChildren()) do
        if v.ClassName == "Accessory" then
            v:Destroy()
        print("Destroyed: "..v.Name)
        end
        end
    wait(0.1)
    for i,v in pairs(char:GetChildren()) do
            if v.ClassName == "Hat" then
               v:Destroy()
            end
        end
    wait(0.1)

it won't even output anything.

0
I ran your code myself as it looked like it should work and it actually worked for me. This means the only thing that could have gone wrong is did you define char successfully? Scarab_lord 20 — 5y

1 answer

Log in to vote
0
Answered by
Slazai 13
5 years ago

You can use Humanoid:RemoveAccessories().

Ad

Answer this question