ID:1692927
 
Keywords: death, system
allows players to kill but not npcs expiation below.
Code:
mob/proc
LevelCheck()
if(src.Exp>=src.Nexp)
src.Exp=0
src.Nexp+=10
src.Level+=1
src.MaxHP+=rand(1,5)
src.Str+=1
src.Def+=1
src<<"You are know Level [src.Level]!"
TakeDamage(var/Damage,var/mob/Attacker)
src.HP-=Damage
src.DeathCheck(Attacker)

DeathCheck(var/mob/killer)//checks to see if you or enemies are dead//
if(src.HP<=0)
if(src.client)
world<<"[killer] killed [src]!"
src.HP=src.MaxHP
src.LevelCheck()


else
killer<<"<b>You killed [src] for [src.Exp]!"
killer.Exp+=src.Exp
killer.LevelCheck()


mob
var/Deaths = 0
proc/UsrDies(D)
Deaths = Deaths + D
proc/HurtMe(D)
HP = HP - D
if(HP < 0)
view() << "[src] dies!"
spawn
loc = locate(/turf/start)
src << "you have spawnend in the death zone!"
src.UsrDies(1)


Problem description:so this is my death proc it doesn't do what I need it to it kills npc but when I hit 0 I don't die or I should say it say im dead but dose not transport me to my death zone. when I use verbs for hurt me it works ill die and be sent to death zone but with interactions of npcs it dose not happen.i figured I could use usr dies for this but I think im doing something wrong when it come to a player dying!

You have 2 different procs to handle taking damage, and 2 different places where you handle dying. It looks like you just threw together code snippets from 2 different tutorials and expected stuff to work.

That's just wrong.
In response to Kaiochao
Yes sorry about that I figured that the bottom code would
would fix it I know what your thinking but I worked on both tutorials reading what needed to be read and writing in the code I suppose I new it wouldn't work my apologies
ok this was an obvious mistake I was able to get it working honestly I figured I could use the bottom code ad reference I didn't copy and paste things in its just easier for to take reference when its right in front of me in stead of another widow any ways wont happen again. ^^