Hello! I am trying to do the following iteration on server.GetCharacterInventory() and I am straight up no table to successfully operand the if statement..... however i've debugged out my incoming ItemId as well the ItemId i would expect to find in the for loop... and they match in a different revision that has the output of both mentioned - but this chunk of code wont do that for me.... what am I doing wrong?
var StringMatched = "not found"; for (var i = 0; i < RetInv.Inventory.Length; i++) //iterate returned inventory, find itemids matching { if(RetInv.Inventory[i].ItemId == PerkID) { StringMatched = "found item!"; break; } } log.debug(request); return {IncomingPerkID: PerkID, CharacterInventory: RetInv.Inventory[0].ItemId}; //return {messageValue: StringMatched};