I'm wondering how I can cancel loops

I don’t know how to save the state of hopping inside a variable. and I don’t really understand custom events lol. I tried doing this,


but it sometimes doesn’t change my speed and air control amount. I’m pretty sure I did it wrong.