I was trying to make an event where the player's pokémon level up by 1, just like Rare Candy. So I thought that using this script would work.
But I'm getting this error:
Exception: RuntimeError
Message: Script error within event 4, map 5 (Rota 31):
Exception: NameError
Message: (eval): 1 :in `pbExecuteScript'undefined local variable or method `pokemon' for #<Interpreter:0xae17ec8>
***Full script:
pbChangeLevel(pokemon,pokemon.level+1,scene)
Interpreter:243:in `pbExecuteScript'
Interpreter:1606:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Interpreter:276:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Any ideas how to solve this problem?
Code:
pbChangeLevel(pokemon,pokemon.level+1,scene)
Exception: RuntimeError
Message: Script error within event 4, map 5 (Rota 31):
Exception: NameError
Message: (eval): 1 :in `pbExecuteScript'undefined local variable or method `pokemon' for #<Interpreter:0xae17ec8>
***Full script:
pbChangeLevel(pokemon,pokemon.level+1,scene)
Interpreter:243:in `pbExecuteScript'
Interpreter:1606:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Interpreter:276:in `pbExecuteScript'
Interpreter:1606:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Any ideas how to solve this problem?