Help with Variables

Im making my first game and thought I understood Variables, but they dont seem to be working as I thought they would


Heres a small piece,


After the top text the scene stops without continuing. 
What I want:


The character collects "Hearts of the city" 
I tried to set variable Heart totals to = the amount the player has in his inventory 
then tried to make conditional branches for each of the totals,  Then under each of those a variable winning percentage that is random, followed by another conditional branch based on the winning percent variable to give different messages and add different variables for wins and losses.
Pictures is one small piece of the code, but the rest is written the same, what Am I doing wrong to make this work?


as it is the Character will say "Ok the results are in" and then it stops.

variables.png
Can you post the next part or two of the event? So far it looks good, and the part you posted will only run if the hearts is exactly equal to 0.
heres some more its long but it keeps following the same pattern but hopefully youll find whatever my mistake is that makes it cut off at the start like that

2.png

3.png

4.png

5.png
Removed
Check your if/elses. You have 5 ends after the >= 5 case, 4 ends in the 1 - 4 cases, and 3 in the 0 case. I think what happened is you set it up that the cases for 1+ hearts is inside the 0 hearts case, which will make it never run. Force the hearts to be 0 and see what happens.
I have no elses, only ifs, and I forced hearts to 0 and it still just shows the first line of text


I'll see if something is inside something like you said
Best way to check is change line two of the event to say variable 2 = 0 (not hearts collected) and see what runs. That way you can better check all the routes. Just be sure to change it back once you are done.
ok after using that tag line it ran to the first txt block but doesnt show anything past the winning percent then.
Two problems.


You have nothing for > 50 for 0 heart, only < 50 and = 50.


The code for < 50 and = 50 are inside the same if, so one of them will never run (whichever is last). You also made the same error if you have 1 heart as well (didn't check the others). What you need is:


if variable = 50


  Code here


END


if variable < 50


  code here


END


if variable > 50


  code here


END


The END tells it to stop running the if code, so you have to be outside to do the next condition. Otherwise, the only condition that will ever run is the first one (as the others are never true).
Two problems.


You have nothing for > 50 for 0 heart, only < 50 and = 50.

I had  ≥  instead of > , 
But the problem was they were all inside of each other thank you very much
Same idea though. If it is solved, let us know and we can close this thread (the way is to report your post and in the report just ask us to close the thread).
ok that part was solved but I have another issue, 


I rewrote the code like attached, and now it does this:


https://youtu.be/CNPAb1W7quk


After he sez "flight outside" its supposed to add +1 to a different variable for wins, then self switch but it continues to run the other code instead of stopping.

new.png
Definitely a hair puller lol, I even tried removing the States won / tied/ lost variables and the code still wont self switch.
Well im not exactly sure what I did but after 3 hours of messing with it I finally figured it out and got it working. 
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-variables.70515/