Unable to destroy backpack item contents

As part of the tool unequip (picture supplied) I am trying to remove items added as part of the equip (picture supplied)
I am checking the server explorer in Studio Test during and after the waits I have in the script (picture supplied) but the items are still in the game.
I have carried out searches but not found any hints.
I suspect there is some connection somewhere that is holding these object but not found any.
I have tried running the destroy in the server command window and the item goes away.
Anyone any hints for me?

Pictures



2 Likes

Are you doing this in a local script? If so the changes would only happen for the client! And would not replicate to the server. Meaning, the items would be removed in the client, but they will still be there in the server, since the removal happened in the client and anything that happens in the client would only affect that client.

That’s why when you see the explorer from the server side nothing happens, turn this into a server script maybe, which will also lead into other changes

And an other minor problem, I can see you’re using _G which is fine, but it is always recommended to not do so, because an exploiter can access that table from anywhere and might be able to mest up some stuff like in this script

1 Like

Thank you. It is in a LocalScript. I will move the action into a server script and invoke it.
I am using _G at the moment as I am finding it more easy.
I will be re-engineering the whole game structure to a more secure shape once I have the fundamentals in this, my first Roblox game, which I am happy with.

1 Like

Very nice! I hope it works perfectly