Selling system script

How do I make a script where it sells all the selected item, I tried making a selling system where it was supposed to sell all the selected item

If your script isn’t working, show it here and we could help correct it.

How do you want the selling system to be triggered? For example, here’s an entity script that gives you points in exchange for all your items, and you can attach it to a keybind:

Or an entity script that does it when you enter a region:

2 Likes

I tried making a selling system with this, it didn’t work well…

1 Like

You are destroying the item, then adding (quantity of selected item) to :dollar:. The quantity at that point is 0, since there are none of it left (you destroyed them just before).
If you increase the :dollar: before you destroy the item, it should work fine. Good luck with your game :smile:

3 Likes

adding to the answer above, you are also using all items owned by last purchased unit. You should be using last triggering unit

5 Likes