ID:138979
 
Code:
mob
proc/Deathcheck()
if(src.HP <= 0)
src.loc = locate(32,31,6)
src << "You were killed by [killedby], and you are now a ghost.You will be a ghost for 5 minutes, then wake up in the hospital wing."
killedby << "You killed [src]!"
killedby.XP += src.lvl + 10
src.XP -= 2
sleep(30)
src.HP = src.MaxHP


Problem description:
This is under construction, so don't worry about the user not being a ghost. The problem is that it says killedby.XP is not defined, but there is a var called killedby and there is a var called XP.

While src.Killedby may be a reference to a mob, I'm pretty sure you still have to typecast it as a mob in the proc.
is killedby defined as a mob?
In response to Quiet Scream
Thanks, I made it a mob in the proc, but I got a runtime error on a mob's death:

runtime error: Cannot read null.XP
proc name: Deathcheck (/mob/proc/Deathcheck)
usr: 0
src: Joshua (/mob/Joshua)
call stack:
Joshua (/mob/Joshua): Deathcheck(null)
Rictusempra Periculum (/obj/Rictusempra_Periculum): Bump(Joshua (/mob/Joshua))
Rictusempra Periculum (/obj/Rictusempra_Periculum): Fire(Rictusempra Periculum (/obj/Rictusempra_Periculum))
BeignetLover (/mob): Rictusempra Periculum()
In response to BeignetLover
if you're using "usr" instead of "src" that may be the problem.
In response to Quiet Scream
I'm not

EDIT:

mob
proc/Deathcheck(mob/killedby)
if(src.HP <= 0)
src.loc = locate(32,31,6)
src << "You were killed by [killedby], and you are now a ghost.You will be a ghost for 5 minutes, then wake up in the hospital wing."
killedby << "You killed [src]!"
killedby.XP += src.lvl
sleep(30)
src.HP = src.MaxHP


mob/mage/verb/Rictusempra_Periculum()
set category = "Dueling"
var/obj/O = new /obj/Rictusempra_Periculum(usr.loc)
O:dir = usr.dir
O:owner = usr
O:Fire(O)


obj/Rictusempra_Periculum
icon = 'Spells.dmi'
icon_state = "rpericulum"
density = 1
dmg = 50
Bump(atom/a)
if(ismob(a))
a:HP -= src.dmg
src.owner << "You hit [a] for [src.dmg] damage!"
a:killedby = src.owner
a:Deathcheck()
del(src)
else
del(src)
In response to BeignetLover
            a:Deathcheck() //passing null as the first argument to Deathcheck()

You are passing null. Of course it's going to say null.XP. That's what you're telling it to do. Computers are 'dumb.' They only do what you tell them to. Nothing more. Nothing less.


Also, do yourself a favor and just define the Bump proc with a /mob as the type of the first argument instead of using the colon everywhere. (You still need the ismob() check, but using colons where you really don't need them just shows a lack of skill.)