Problem with global variables (SOLVED)

Hello, as you can see in the photo below, i am trying to show a text and change the amount of the global variable when the global variable = global variable + 30 but it doesnt work…
Keep in mind this is not the main scene, if i play it from main scene it doesnt work, if i play it directly from this scene, it works…what am i doing wrong?

This is a subevent but it works if i dont put in the globalvariable before the +30, it works nice…shows the text and updates everything, as soon as i put the global variable before the +30, i think it works but it doesnt show the text and also it update the amount properly

Also i cannot put just +30 because it is not the main scene, this is a minigame i have from time to time, so the player enters already with some gold amount, therefore i need a work around or a fix to this, please

I fixed it on my own, apparently im wayyy too dumb…Anyway if someone ever faces my problem, here is the simple fix i found…

Basically, you create a temporary scene variable that stores the amount the player found and therefore after you know the amount, you update the main global variable with the temporary variable… you can see in the screenshot… :smiley: