ID:149336
 
Well, I put a little combat in my game, and when I attack a mob I end up dying. This is the code for the attack:

mob/verb
punch(mob/M in oview(1))
usr << "You punch \the [M]."
oview()-M << "[src] punches [M]."
M << "[src] punches you."
M.HP -= src.Strength - M.Defense
usr.LevelUp()
M.DeathCheck()

And since the DeathCheck proc is what locates you at the starting point when you die here is the DeathCheck proc:

mob/proc/DeathCheck(AD)
HP = HP - Strength - AD
if(HP < 0)
src << "You have died!"
oview() << "[src] has died."
if(usr.key)
usr.Move(locate(/area/fountain))
else
del src

When I attack a mob, I end up where the DeathCheck locates you, but i dont see it say "You have died!"... any suggestions?
You don't seem to know the difference between "usr" and "src" here, a common mistake for newcomers (notice that I don't say "newbs"... but, guess that's blown. :oP) src is the owner of the proc. When you call M.DeathCheck(), M will be src in DeathCheck. usr is the person who called the proc. So, when M.DeathCheck is called, usr will be you, the person who attacked him. So, since usr is being moved but src is getting the message, you get the problem that you're having. Change src to usr if you want the usr to get the message, or change usr to src if vice-versa. Good luck!

-LoW