ID:166596
 
This is kind of a stupid question but I must ask it. I need a simple code for a monster that attacks me back and that dies, respawns all that stuff. I tried looking it up in the Demo's/Libraries and it came up with codes that I had no idea what I was doing. And I really couldn't find a simple one. Something a 5 month old coder can understand. Thank you for your help.

~DarkD3vil~
You can use, a proc. It is easy to edit.
mob/var/hp=10203546
mob/var/atts=0
mob
Monster
icon=whatever
New()
..()
Monster()
mob
proc
MAttack()
for(var/mob/M in get_step(src,src.dir))
if(src.atts)return
src.atts = 1
var/dmg=rand(1,15)
if(dmg<=0) dmg=0
M.hp-=dmg
//some sort of death check
sleep(30)//a delay of seconds before next attack
src.atts = 0
mob
proc
Monster()
var/mob/M //if you have your chracters as mob/character or something, change accordingly
while(src)//check and see if it is still alive
if(M in oview())
walk_to(src,M,1,1)//Movement will stop 1 space away, and he will walk REALLY fast.(No running away =))
if(M in oview(1))
step_towards(src,M)
src.MAttack(M)
spawn(1)
Monster()

I had this posted way earlier, but i thought there would be someone who could help you better.
In response to Evidence
Thanks, now how would I attack it? I mean i'll try and make it myself but i'll probebly get it wrong.

~DarkD3vil~