Number addition gone wrong? Help needed

Here’s a video of whats happening in the game. I want 2 to be added each time I press the number 1 key.
https://drive.google.com/file/d/1A8MTbHtcb_MVjM5cFMPJW2goxeTN7TxH/view

Here’s a link to the game, the code is in the inv type block. Pressing the number 1 key should add 2 to the number block.

https://flowlab.io/game/view/1527405

Any help would be greatly appreciated

Also, it does the addition wrong with every number, not just 2. And its only happened to me on this game, trying the code out on a new game fixed the problem.

I fixed it, I think it was inputting multiple two’s in previously. When I added a short clock, it fixed it to give only one input of two, thus adding only two.

@Caleb_Strawberry_3
It was because you had the Keyboard input inside the inventory slots.
And you have 4 inventory slots, so you were getting multiples of 8 before.

2020.11.02-11.56 (2)

You moved the Keyboard input to the player, so it is fixed now.
Here is just the reason why it was doing it like that.

(You fixed it while I was looking lol)