Script does not remove accessories

Hello there!

I made a script that removes player’s accessories but it doesn’t work.

This is my script:

            if accessory:IsA("Accessory") or accessory:IsA("Hat") then
                accessory:Destroy()
            end
        end

Without additional context about the function / loop / etc. that this code is running in, it’s not really possible to know what might be preventing it from working. Excluding the last end, on its own, this looks like it would successfully destroy the referenced object if it turns out to be an Accessory or a Hat.

Aside from that, are there any errors appearing in the Output?

I fixed it alone nevermind but thanks for yout trying to help.

1 Like

I still have problem…I opened the topic.

Can you give me full code? I can’t help without full code

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.