ai_random_wander()//random wander if no mobs are in range to attack
if(src.key)//if the source is human
return//don't call the rest
if(!src.edoEnemyKisame&&!src.FiveTails&&!src.TenTails&&!src.Stranger&&!src.weaknin&&!src.orochimaru&&!src.Kyuubiface&&!src.Aeishiou&&!src.EnemyTele&&!src.EnemyShield&&!src.EnemySasori&&!src.EnemyKisame&&!src.EnemyZetsu&&!src.EnemyTobi&&!src.EnemyDeidara&&!src.EnemyLeader&&!src.EnemyKonan&&!src.Tobiobito&&!src.EnemyItachi&&!src.EnemyKakuzu&&!src.EnemyHidan&&!src.EnemyKimimaro&&!src.EnemySakon&&!src.wildbeast&&!src.EnemyJiroubou&&!src.EnemyTarfex&&!src.gmman&&!src.EnemyTayuya&&!src.EnemyKido&&!src.demon&&!src.guard&&!src.EnemyItachiM&&!src.EnemyMadaraM&&!src.EnemyKakashiE&&!src.EnemyNarutoE&&!src.EnemySasukeE&&!src.EnemyJiraiyaE&&!src.EnemyHokageE&&!src.Peinbody1&&!src.Snake89)
return
else
walk_rand(src,10)//walk randomly with 5 lag
src.ai_run_away()
spawn(10)//delay for one tick
ai_random_wander()//wander some more
The if(src.key) is there cuz i have a verb which lets us control NPC
I'll be able to give better advice once I see the code for it.