ID:263147
 
Code:
        Death()
var/M
M = src
if(istype(M,/mob/Player))
while(M)
if(M.Hp>0)
break
return
else
if(M.Hp<=0)
M<<"<font color = yellow><b>You have died! You can choose to return now at the cost of half your gold, or wait for someone to revive you.</font></b>"
sleep(35)
alert("Return to your home point?","Home Point","Yes","No")
if("Yes")
M.Move(locate(M.TX,M.TY,M.TZ))
M<<"<font color = yellow><b>You have lost half of your gold. You currently have [M.GP] gold left.</font></b>"
sleep(5)
break
return
if("No")
M<<"<font color = yellow><b>You have 3 minutes to be revived, else you are returned to your home point. To return anytime while down, press the center key on your number pad.</font></b>"
sleep(180)
if(M.isdead>=1)
M.Move(locate(M.TX,M.TY,M.TZ))
M<<"<font color = yellow><b>You have lost half of your gold. You currently have [M.GP] gold left.</font></b>"
break
return
else
break
return


Problem description:
Undefined vars -
M.Hp
M.TX
M.TY
M.TZ
M.GP
M.isdead
Undefined proc
M.Move

var/M
M = src

you not defining M as a mob.. var/mob/M will fix your problems
In response to A.T.H.K
O.O That was the first thing I tried, and it didn't work, yet now it does...Maybe I had a typo. Oh well, thanks.
Using the M var here for no reason is ludicrous. Just use src!

You also need to be sure to send the alert() message to src, because otherwise it will default to sending the message to usr which is incorrect.

And do fix your HTML. Never ever put a space between the attribute and the value (e.g., color = yellow is wrong).

Lummox JR