In this example that lennaert gave me wouldn't the inventory array 0,2 = check for swordstrength not the amount of the item? i just started creating these arrays and i ran into this question. sorry if this is a silly simple or obvious thing, bear with my dumbness. but i would think i need another Y variable in all items array for "amount" am i right?
example
all items
x,y
0,1 = "sword"
0,2 = swordstrength number
1,1 = "shield"
1,2 = shield strength number
2,1 = "potionX"
2.2 = potion health amount number
Then you have 1 small array, where each item you posses take up a X index, where its Y(1) hold the id from the x based index of your total inventory array, and the Y(2) determine how many you have of them.
Player Inventory
x,y
0,1 = 0 (x ID from the sword)
0,2 = 3 (you have 3 swords)
1,1 = 2 (x ID from the potion)
1,2 = 10 (you have 10 potions)