If statement using actors level

Hello,

I was wondering if someone could help me with a if statement calling on the actors lvl?

if actors lvl is between x and y 

else if actors lvl is between x and y

Thanks for any help in advance
if $game_actors[id].level > x and $game_actors[id].level < y


that excludes x and y, if you want to include those


if $game_actors[id].level >= x and $game_actors[id].level <= y
ok so i got it to work except for now im getting a error when i test game and try to go into menu.  it says undefined method 'level' for nil:NilClass

code with your suggested changes

if $game_actors[0].level > 10

      @tp.to_f / 4

    elsif $game_actors[0].level > 10 and $game_actors[0].level < 20

      @tp.to_f / 5

    elsif $game_actors[0].level > 20 and $game_actors[0].level < 46

      @tp.to_f / 6

    else $game_actors[0].level > 46

      @tp.to_f / 7

    end
I told you already on your PM that actors start at 1 not 0... you should read more
oops... sorry, got it now it working perfect thanks for the help I appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/if-statement-using-actors-level.23929/