i did this logic to check if an item is stackable, and if yes, increase the quantity instead of create a new item, but i’m having a problem that if I get two different items but if they are both marked as stackable, it will return that the item ids are the same, even though they are different
ItemToAdd should be a local variable and passed into the function directly otherwise you could get the wrong data.
same with your other variables there, ShouldStack/Index make sure they’re all local variables