var/Level=round((src.Mtai+src.Mnin+src.Mgen)/100)
Ok! i figured out the order of operations. But if i use a code such as
if(usr.rank=="Genin"&&usr.Level >= 250)
and compile it errors with "var Level is not defined"
If i add a separate var for Level the first code does doesn't effect the second.
Sorry for my newb issues I'm just learning ^.^
thanks for anyone who could shed light on this issue.
var/Level=round((src.Mtai+src.Mnin+src.Mgen)/100)
var/Level is local to that script while usr.Level is local to the user.
usr.Level is not Level.
In other words add a var named Level to mob
mob/var/Level=1
Then change this
var/Level=round((src.Mtai+src.Mnin+src.Mgen)/100)
To this
usr.Level=round((src.Mtai+src.Mnin+src.Mgen)/100)
You should generally avoid usr and instead use src.