mob monster New() //all the things that happen when he is created\ you should know this. Ex: walkaround(src) Del() //this is what you need. ..() //call the deletion proc sleep(30) //sleep 3 seconds new/mob/monster() //i'm not sure where you want to locate\ him, but you should know how to do that.
Bump(mob/M) if(istype(M,/mob/character)) attack(M) proc/attack(mob/M) var/damage = rand(1,ATK) M.hp -= damage M <<"You are being attacked by [src]!" src.level_up() M.death_check(src)
Del() //this is what you need. ..() //call the deletion proc sleep(30) //sleep 3 seconds new/mob/ennemies/Rat() //i'm not sure where you want to locate him, but you should know how to do that.
I have no errors at all but the problem is they still don't spawn after 3 seconds.
PS: the rats are spreaded on map so there are like 10 of them so its a little problem with the locate on the last line.
Del() //is called when the mob is deleted (but not yet) var/oloc=src.loc spawn(30) new src.type(oloc) //I forgot the workaround method for this ..()
When you call ..(), it calls the parents proc.. which has the actual deletion of the object, so when you called the ..() first, it deleted the mob thus the rest weren't called.
Alternatively, you could make it relocate after it "dies"
Del() src.z = 0//it goes to THE VOID sleep(30) src.restore_stats() src.loc=initial(src.loc) if(!z)del src //if it has no initial location [eg: not placed on map), it is deleted
It will just teleport them to a new spot on the map for 1 minute.
*faints*
You might want to look at that again.....
Also, you should probably have separate DeathCheck() and Die() procs, possibly a TakeDamage() one as well..