ID:162042
 
Okay, heres my code:

 mob/Monster
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = 0
for(var/mob/M in oview(5,src)) //Looks for mobs in view
if(!M.client) continue //If the mob has no client, it's not a player, so skip it
step_towards(src,M)
Found = 1
break
if(!Found)
step_rand(src)
sleep(10)
sleep(5)

Bump(mob/M)
if(ismob(M)&&M.client)//Make sure it bumped a mob with a client, meaning a player
monAttack(M)
proc/monAttack(mob/M)
//flick("attack",src)
if(src.doing >= 1)
return
else
src.doing = 1
var/damage = src.strength-M.defense+rand(1,5)
if(damage <= 0)
return
else
sleep(40)
M.health -= damage
M << "\red [src] attacks you for [damage]!"
M.deathcheck()
src.doing = 0


It works more or less, but I'm not sure how to make the mob respawn. Could it be that in my death check i put del(src) if fighting a monster, or am i missing something? Please help! ^^
If you want it to respawn then you're going to have to not delete it. Instead, set its loc to null, then spawn(600) loc = initial(loc).
In response to Garthor
Thanks mucho, we can finally get our game hosted. =D