Event variable going down after pressing a button?

I'm trying to make it so that after player presses an OK button, Events Variable goes down, and after it reaches 0, Event dies (Basically, Im trying to make a simple battle system). I did this:



But it doesn't seems to be working. What am I doing wrong? It doesn't sound like it should be difficult to make.
Because the "Control Variables #0021 = 1" will always trigger before you check if the variable is 0, it will always be set to 1, even if you made it go down to 0 before.
You could probably adjust the variable in a different event or a different page.

You could make page 1 "Control variables: #0021 = 1"
Self Switch A = On

and on page 2 you only activate it when self switch A is on, and then you have only your
"if HP = 0" conditional branch.

Hope that makes sense.
I understand why my method is not working, but I'm not sure if I understand your propose 😀
If I do this:


Then it goes straight to page 2, so the event never appears.
Can you clarify what you mean with "the event never appears"?

Well, the idea is that the event itself (so perhaps the sprite of the character) is on page 2. 🙂
Ahh, got it, it works, thank you 😀

Original thread: https://forums.rpgmakerweb.com/threads/event-variable-going-down-after-pressing-a-button.115659/