Hello again now I'm struggling on: when I left click on a item, like a potion, it substract it's amount or, if the amount goes to 0, the item gets destroyed. The problem is: when I add an item again, it's added only on the slot that had the deleted item, so when I get another item, it can't go on front of the last inventory slot
here is the updated code
and the code to delete the item, or substract it's amount