die(mob/M)
if(src.hp<=0)
if(src.key) //checks if it's a player
src.loc=locate(1,1,1) // locates the player back to the respawn point
src.hp = src.maxhp
src<<"You've died"
M.exp += src.maxexp/2
M.gold += src.gold / 2
else
M.gold += src.gold
M.exp += src.maxexp
del(src)
spawn(src.respawn) //Waits respawn amount
src.loc = origloc // Moves the monsters back to his original location
Problem description: Runtime, cannot read null.gold, though the src's (monsters) has 1 gold