ID:272014
 
How do I make an automatic attacking and chasing mob?
You make it check for mobs around it. It's called "AI," or artificial intelligence.
I'm still working on basic stuff so I haven't created an aggro mob yet, but I think the following might work if you fill in the blanks.

mob
aggro
var/mob/target
var whatever = 5
New()
spawn (whatever) heartbeat()
proc
heartbeat()
while(1)
target=findtarget()
if(target) chaseandkill(target)
healalittle()
sleep(whatever)
findtarget()
var/T
// put code to check for player mobs here
return T
chaseandkill()
// put code to chase and attack them here
healalittle()
// put code for stuff while resting here


There are other ways to do this. For example, if the mob is put in a certain room, you could have the turf at a doorway trigger it to attack instead.