a question about scripts and $gameVariables

i just wanted to know if
"
$gameActors.actor(1)._level = $gameVariables(880)
"
is something that works, because im trying to make a way to choose what level to grow to, and i found an "input number" to script would work best, but apperently it isnt
Try something like this instead:
JavaScript:
$gameActors.actor(1).changeLevel($gameVariables.value(880), true);
I.e. "change the level of actor ID 1 to the value of game variable 880, and show level up messages". Swap true for false to not show level up messages.

Alternatively, I think you could do this with no scripting, e.g.

◆Comment:Input value should start at current level ◆Control Variables:#0010 Level = Level of Harold ◆Comment:Get user input (target level) ◆Text:None, Window, Top : :Set Harold to level: ◆Input Number:Level, 2 digits ◆Comment:Get level difference (current -> target) ◆Control Variables:#0010 Level -= Level of Harold ◆Comment:Change level by the difference ◆Change Level:Harold, + {Level} (Show Level Up)
i see i see, ill try both opitions! thanks

Try something like this instead:
JavaScript:
$gameActors.actor(1).changeLevel($gameVariables.value(880), true);
I.e. "change the level of actor ID 1 to the value of game variable 880, and show level up messages". Swap true for false to not show level up messages.

Alternatively, I think you could do this with no scripting, e.g.

◆Comment:Input value should start at current level ◆Control Variables:#0010 Level = Level of Harold ◆Comment:Get user input (target level) ◆Text:None, Window, Top : :Set Harold to level: ◆Input Number:Level, 2 digits ◆Comment:Get level difference (current -> target) ◆Control Variables:#0010 Level -= Level of Harold ◆Comment:Change level by the difference ◆Change Level:Harold, + {Level} (Show Level Up)

It worked! Thank you so so much!
Great, you're welcome!

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/a-question-about-scripts-and-gamevariables.145476/