here is my code
var/mob/PC
mob
NPC
Brolly
name = "{NPC} Brolly"
icon = 'Enemy.dmi'
density = 1
Health=25
Defence=1
Strength=2
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(var/mob/PC in oview(6)).
step_to(src,PC)
Found = TRUE
break
if(Found != TRUE)
sleep(8)
sleep(8)