(Solved) Double key press for speed increase/dash

In the example below I’m trying to get player to press the “Right” key twice in quick succession in order to increase speed. Once sped up, when they let go of the key, the speed goes back to normal.

Something is wrong with my code. It seems to work sporadically. Sometimes it works only once (like straight after a fresh load). Other times it’ll work as expected a few times in a row, but eventually it stops working and the double key press ends up doing nothing. Any ideas?

Got it now. It seems to work around 8 times of 10.

The 2 times it doesn’t work, I’m pretty sure is just a problem with my wireless keyboard occasionally not registering the second key press in time. Because the variables are being updated correctly as displayed in the text objects.

So if anyone needs double key press in the future, here’s the code.
*Don’t need to include any of the Text related events. I just put them there to test the variables in text objects.