Problems with looping a remote event

I’m trying to make a training tool where you have to randomly press buttons 21 times and the value goes up by +1 every time the button is pressed, but for some reason it starts going into negative numbers and each time the valued is updated it goes up by 1 less number.

for example:
-14
-25
-37

whereas its supposed to be:
1
2
3

Move first appearance of button variable to inside of repeat loop.

1 Like

put the local button = true into the loop?

yes. put into loop first.
button always true first looks like.

theres a button = false in the loop until the right button is pressed