proc
AosLoop()
if(src.client)return
var
list/piv
mob/attack
while(Health>0)
piv = list()
while(piv.len<=0)
if(walks)
step_rand(src)
sleep(wspeed)
for(var/mob/m in oview(1))
if(m.client&&m.key)
piv+=m
attack=pick(piv)
while(get_dist(attack,src)<=view)
if(get_dist(attack,src)==1)
var/dmg=rand(mdmg,Mdmg)-attack.def
if(dmg<0)
attack<<"[name] has attacked you,but missed you!"
sleep(aspeed)
attack<<"[name] has attacked you for [dmg] damage!"
attack.Health-=dmg
attack.Death(src)
sleep(aspeed)
else
step_towards(src,attack)
sleep(wspeed)
if(walks)
step_rand(src)
sleep(wspeed)
Problem description:
hi, how can i make it so that the monster can only move when it gets attacked, so its standins till untill someone attacks it then it runs after it.
You'll also have to change oview(1) to oview(src,1) or you'll get logic errors.