ID:263743
 
Code:
mob
proc
Death()
if(src.Enemy)
if(src.hp <= 0)
range()<<"[src] has been killed by [M]."
M.exp += src.exp
del src
return
if(!src.Enemy)
if(src.hp <= 0)
range()<<"[src] has been killed by [M]."
src<<"Oh Dear you have died."
src.loc = locate(40,40,2)
if(src.race == "Human" && src.rank == "None" && src.hollowcheck == 0)
switch(input("Would you like to become a Hollow?")in list("Yes","No"))
if("Yes")
world<<"[src] Has become a Hollow!"
src.icon = ""
src.race = "Hollow"
src.rank = "Weak"
src.loc = locate (20,20,1)
if("No")
world<<"[src] has fought the urge to become a Hollow!"
return


Problem description:

Game Programming\Deathproc.dm:6:error:M:undefined var
Game Programming\Deathproc.dm:7:error:M.exp:undefined var
Game Programming\Deathproc.dm:12:error:M:undefined var

I have no idea why it is doing that. Can someone please explain? Also, I did make this code it is in now way ripped or stolen. Thank you.

mob
proc
Death(mob/M)
if(src.Enemy)
if(src.hp <= 0)
range()<<"[src] has been killed by [M]."
M.exp += src.exp
del src
return
if(!src.Enemy)
if(src.hp <= 0)
range()<<"[src] has been killed by [M]."
src<<"Oh Dear you have died."
src.loc = locate(40,40,2)
if(src.race == "Human" && src.rank == "None" && src.hollowcheck == 0)
switch(input("Would you like to become a Hollow?")in list("Yes","No"))
if("Yes")
world<<"[src] Has become a Hollow!"
src.icon = ""
src.race = "Hollow"
src.rank = "Weak"
src.hollowcheck = 1
src.loc = locate (20,20,1)
if("No")
world<<"[src] has fought the urge to become a Hollow!"
src.hollowcheck = 1
return


I changed it to this and i got no problems but i want to know if it will work?

If the first argument when calling the procedure is the mobile that you're checking to see has killed the source, then yes, it should work fine.

I suggest you read the DM Guide in any case, because you don't seem to know what's happening.

edit: to the deleted reply you made-

I just kind of figured, since you didn't know that the nonexistant object you were trying to reference didn't, you know, exist.