ID:170306
 
How would I make an npc run away if your sin is high enough. I tried making a new() proc for the NPC but it doesn't work >.< Wondering if someone could help me, Thanks in advance.
mob
proc
SinRun()
if(src.sin>=number) //Replace number with the ammount of sin you want to use.
for(var/mob/m in oview(distance,src)) //Replace distance with however many tiles you want to use.
if(ismob(m)&&!m.client) //To make sure its a mob with no client.
step_away(src,m)
spawn() src.SinRun()

I think that should work