Page 1 of 1

need some help with my ondeath

Posted: Mon Dec 12, 2011 8:57 pm
by dragon slayer
here is what i got

Code: Select all

function onDeath( pDead ) 
{    
     var nSpawned = SpawnNPC( "boneknight", pDead.x, pDead.y, pDead.z, pDead.worldnumber );
} 
what i want it to do is make a effect and delete the corpse when the npc spawns. i have try differant methods and failed

Posted: Mon Dec 12, 2011 9:24 pm
by Xuri
It doesn't trigger at all? The script you've got in your post there looks like it ought to spawn a boneknight when the character the script is attached to dies.

Doing something to the corpse item is harder. Don't have the code handy right now, but I'm guessing that onDeath triggers _before_ the corpse is created, allowing you to override the death if you want to (Miraculous recovery! You're not dead!).

Posted: Mon Dec 12, 2011 9:39 pm
by dragon slayer
yeah maybe should be onbeforedeath?