You need to post the insides of those custom functions! What’s happening is you’re trying to get an index of the Inventory array that isn’t there, giving you a null reference exception. Which, if this code is correct, shouldn’t happen UNLESS the bool output of your previous function was backwards. Give looking into that a go!