Turn switch on level up

Hi is there a way turning on the switch on level Up ? I have the command line  "$game_switches[16] = true" but I don't know where put this line... triend many ways on the Game_Actor but it's not working...
On the conditional branch, there is a place on the 4th page of conditions to input a script line. Maybe put it there?
Use it in a conditional branch using a script call with the line you have as the condition.
class Game_Actor < Game_Battler  alias hollow_level_up_switch_game_actor_level_up level_up  def level_up    hollow_level_up_switch_game_actor_level_up    $game_switches[16] = true  endend^Put that in its own slot below Materials and above Main in your script editor. Just be sure to turn the switch off after you finish what you're using it for.
Thank You all for helping me! 

class Game_Actor < Game_Battler  alias hollow_level_up_switch_game_actor_level_up level_up  def level_up    hollow_level_up_switch_game_actor_level_up    $game_switches[16] = true  endend^Put that in its own slot below Materials and above Main in your script editor. Just be sure to turn the switch off after you finish what you're using it for.
The Hollow method worked very well ! Thank You Very Much!

Original thread: https://forums.rpgmakerweb.com/threads/turn-switch-on-level-up.41883/