ID:313585
 
(See the best response by Neimo.)
Code:
    proc
deathcheck(var/mob/M)
if (src.hp <= 0)
if(src.client)
oview()<<"[M] Killed [src]!"
if(basedeath)
icon_state="death"
if(lizarddeath)
icon_state="death"
sleep(60)
icon_state="walk"
src.hp=src.maxhp
src.Move (locate(1,1,1))
else
M<<"You Killed [src]"
M.exp+=src.exp
M.levelup()
world << "[src] dies!"
del src


Ok I got the dying states working but the problem i have is that they can still move while died. Also they can still be attacked by monsters while die and their health goes in the negatives. Help please.

The problem is that you just change the icon state of the mob and nothing else.
You'll have to override the East() North() West()... procs so the mob can't move while their icon_state be "death"
And make the monsters ai ignore death targets.
Andē probably change the verbs and other things too...
Thanks for your help. Ill try and fix it now.
Best response
He doesn't need to override all of those when he can simply do it once in mob/Move().

var/tmp/dead = 0
var/tmp/deadtime = 0

deadtime = world.time + 600 // set deadtime to 1 minute

mob/Move()

if(dead || deadtime > world.time)
return

..()
Thanks Neimo, I have one problem though. The line is saying empty type name. (indentation error?)
deadtime = world.time + 600


That was an example of using the deadtime variable, you would place that in deathcheck().