how to find the value of a specific member in an index in a struct array


This is what I’ve got so far (it doesn’t work). the goal is to only open the door if the player has a certain amount of “repair kits”, the struct I’m using is my inventory, each time I pick up an item it will create a new index and in that index it will store, The item name, if it’s unique (only one can be picked up), and the quantity.

My issue is I can’t figure out how to reference the item quantity. I’ve figured out how to find the correct index, but not what’s in it.

Edit: I’ve also tried this.

So what’s the exact problem you have? First thing that I noticed is that you are iterating through all of the items and always generate an error message even if you have enough keys in some other entry.