It’s probly very simple but I’m trying to figure out how you add or subtract and compare elements in the array in if statements.
var items = new Array(2,0,0);
if(items[0] > 0) {
items[0]--;
}
So the question I have how must I rewrite this to get this to work? I’m trying to keep track of multiple items of each the player has. So when they go to use one or get one added to their inventory it will change which ever value it needs to in the array.