[Closed] [SOLVED] Remove one of multiple of the same item from array

Milo_911
Sun, 01 Dec 2019 20:09:54 +0000
Editor Scripting

Alright, I’m having trouble with this - I’ll do my best to explain it without over complicating things:

Lets say i have 5 health potions in my inventory. I want to be able to press a button and drink a single potion and remove it from the array. The problem I’m running into is that when i remove that potion from the array, it removes ALL 5 of them. Right now I have it set up so when I click the button to check if the inventory array contains the item, then if it does, play a sound and remove it from the array. How can I get it so it only removes a single one of those items?

Thanks,

4 posts - 1 participant