ID:176615
 
How would i make it so that the monster only attacks you when you attack it? Thanks in advance here's my code:

Click()
if(get_dist(usr,src) <= 2)
usr.attack(src)
sleep(100)
else
...()
proc/move()
for(var/mob/M in oview())
if(get_step_away(src,M,3))
if(!M.client)
continue
else
walk_to(src,M,1,2)
else
continue
spawn(20)
move()

proc/attackplayer()
for(var/mob/M in oview(1))
if(get_step_away(src,M,1))
if(!M.client)
continue
else
src.attack(M)
else
return..()
spawn(20) attackplayer()

New()
attackplayer()
move()