mob
proc
AI()
if(src.NPC == 1)
return
if(src.NPC == 3)
return
if(src.NPC == 2)//If it's a NPC that is supposed to use this AI
while(src)
for(var/mob/M in oview(6))
if(M in oview(6))
if(M.NPC == 0)//If it's a player
walk_to(src,M,1,5)
if(M in oview(1))
var/Damage = (60+src.str-M.def)
view() << "[src.name] attacks [M.name] for [Damage]"
M.hp -= Damage
if(M.hp <= 0)
M.Death(src)
else
walk_rand(src,10)
break
else
walk_rand(src,10)
break
walk_rand(src,10)
break
spawn(1)
AI()
Problem description: The problem is that the AI acts really random, sometimes it will follow me as it's supposed to but in most cases it will walk randomly and then just suddently stop walking and when I get in range 1 of it it will attack me, but it's supposed to follow me every time and not stop when I get in range 6
/Regards
Valyrin