I found something wrong on the new code: The items stopped being able to stack, now when I try stacking, the amount turns into the ID of the items on the inventory. Also, when I click on a potion item that amount is over 2, all are used, but I wanted to make only 1 item get removed.