Help with a simple "if X and if Y" event

I'm trying to make a simple event but Im making a mistake somewhere and I don't know where.

I created a variable "Tired", made a Common Event that checks if Tired is between 10-20, and if so, it displays a balloon icon.
Just to test it, I created an NPC that adds +4 Tired every time I talk to it.

After talking to the NPC 3 times, the Balloon Icon shows up, but doesn't disappear. It stays there until I talk to the NPC enough times for the Tired variable to be higher than 20.

What am I doing wrong? I want to make it so that if the Tired variable is between 10-20, something happens in the background, if between 21-30, something else happens and so on.
we can't tell you what you're doing wrong if you don't show us what you've done.

what you want can be done with a very simple structure of event commands, you just have to follow mathematics and logic - and there are too many places where a minor mistake can cause the bug you describe.

so please give a screenshot of your event commands and we'll tell you where you made your mistake.
Sorry! So, this is the Common event:
Screen Shot 2021-10-03 at 16.51.33.png


And the event that adds the Variable
Screen Shot 2021-10-03 at 16.51.26.png


And after I talk to the NPC 3 times, I get this:
Screen Shot 2021-10-03 at 16.54.34.png

It's not animated or anything, just stays blank like this until I talk to the NPC a few more times so that the variable is higher than 18
It's not animated or anything, just stays blank like this until
and the reason for this (and other problems ) is that you don't give enough time for the animation to complete before you give the command again.

parallel processes are executed sixty times PER SECOND.
so the next iteration of the command is given before the last one can do more than display the first frame.
you'll need a wait command inside the parallel process to give the engine time - at least wait(10), probably longer depending on the animation or balloon.

after you added that, test again (and incrase wait until the full sequence plays)
Sorry if I wasn't clear, I only want the event to be executed one time once the conditions are met. So, if Tired gets anywhere between 10-18, the event happens. If it gets higher than that, something else happens, if it gets back to 10-18, the same event is executed again, but only once.
in that case, you should not use a parallel process at all.

set trigger to none, and add a call event to that common event directly after each adding to the variable.
Yes, that works! Thank you so much.
I also recommoned to make it shorter on the conditions.
ALoe makes a conditional branch++ to make things shorter.

if you dont want to a use a plugin use a scriptcal

if: script: $gameVariable.value(x) > 10 && $gameVariable.value(x) < 20
do stuff
else
do other stuff
end

just make sure like andar said, to put a wait in there.
you can also make a condition with wait variable > 200
or something to repeat the process, otherwise, break it.

it can make things easier and smoother for you as well 🙂

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-simple-if-x-and-if-y-event.140984/