@Elliott404
Ok, let's play through the entire event, assuming that we have 127 mana and leveling up costs 100 mana.
Keep in mind, that you have to set the leveling cost for the first time (In this case 100) elsewhere.
Now, we call the common event:
#1 The conditional branch checks if we have enough mana -> 127 >= 100?
We
do have enough mana, so we proceed to leveling up.
#2 We subtract the mana needed (100) from our 127 because we just spent 100 mana
#3 The message plays, saying how much mana we spent and how much we have left.
#4 Then we increase the amount of mana needed to level up again.
-> Assuming you are using my formula, the mana needed jumps from 100 to 150.
-> $gameVariables.setValue(
X, Math.floor($gameVariables.value(
X) * 1.5));
X is the variable ID of your
Level UP! variable
#5 If you call the common event again, we have 27 mana left, but now leveling up costs us 150 mana.
#6 Else-branch:
This one is optional, we can calculate (for comfort) how much more mana the player needs to level up.
1. For that we set a third variable to 0.
-> that would be your
\I[73]Next Lv.
2. Then we add the amount of mana needed for the next level up
-> \I[73]Next Lv. +
\I[72]Mana
3. Then we subtract the amount of mana we have ; we get the amount we need to aquire to level up.
-> \I[73]Next Lv. - Level UP!
4. We play the message
Also Make sure all the variable ID's are correct, this is very important
it seems you swapped the variables in the script call, you need to put your Level UP! variable in there.
Edit: @Elliott404 Here is how it should look for you, But make sure to change all variable ID's to their correct ones. Try to make it 100% identical. (see the attachment)