mob
proc
DeathCheck(mob/M)
if (src.Hp <= 0)
world << "[src] dies at the hands of [M]!"
del(src) //delete whatever just died
src.Hp = 30
src.loc= locate(1,1,2)
mob
var/Str = 5
var/Def = 5
var/maxHp = 100
var/maxReiatsu=100
var/Endurance = 5
var/Hp= 100
var/Reiatsu= 100
var/wealth=100
var/maxStr=5
var/maxDef=5
var/Level=1
var/Rank="Starter"
var/inventory[0]
if u need more plz tell me
Eg: <DM>obj/var/apple</DM> =
obj/var/apple
Also, take your time to type out everything so we have a better chance of understanding what you want (and no begging please).
Now, the snippet you have provided is useless to the topic in question; a suitable snippet you could have shown us is your AI code.
Essentially, you make an infinite loop which should be spawn()ed when it is created, making it search for opponents. If the mob's level is <=monster.level-5 && mob.level>=5, it should walk towards that mob, attacking and such.