Hello Everyone!
Anyone knows why my "for each loop returns only the first index?
My Slot Array has 2 itens but my function returns true only when i interact with the first index. When interact with the item in second index the function returns false.
I’m trying to develop an inventory and this function is to know if the item exists or not in slot array.
Look at your code. If the first one isn’t it, you return fail.
Because it’s a function it will ‘short circuit’ when it finds the item, so you don’t need the break.
@atlasat has the idea.
1 Like