ID:264241
 
Code:Resurrection Spell
    resurrecthud
name=""
icon='HUD.dmi'
icon_state="resurrect"
layer=91
screen_loc="11,7"
MouseEntered()
icon_state="resurrectmove"
MouseExited()
icon_state="resurrect"
Click(mob/M)
if(src in oview(2))
if(usr.mp<=20)
return
if(!M.client)
if(!M.dead)
usr.mp-=20
M.overlays+=new/obj/resurrect
usr.PowerAdd()
M.DeathOverlaysRemove()
M.hp=10
M.dead=0
M.walk=0
sleep(4)
M.overlays-=/obj/resurrect


Problem description:Ok when i stand next to a dead player and click resurrect it doesn't work, i have a cure spell just like this and it works.

Ralphie_leo wrote:

                    if(!M.dead)
>


Checking if M.dead is not true might prove hazardous.
In response to Schnitzelnagler
Additionally, most of the proc is botched anyway; M is never even a valid mob to begin with for this purpose, the first if() check is checking if the clicked [HUD] obj is on the map next to the player, not if a mob is, and lastly, as you've mentioned the actual resurrection code is set to only execute if the mob is both NOT a player and alive.
The usage of the new() proc is also extraneous.
In response to Kaioken
Are you trying to heal an NPC or a player?

That "if(!M.client)" line is checking to see if they are NOT a client, you know.