At the moment it's not possible to run onUse JS events for ghosts, since the source code does a "ItemIsUsable" check before getting that far, and returns false if your character is dead. :/
This, I believe, is done to avoid having to put pUser.isDead checks into every JS script that uses the onUse event
Ah, this is what I assumed was happening. So there is no way to bypass this? The deathrobe idea would be ideal for RP purposes, but I came up with an alternative if onUsed would NEVER work with ghosts:
Can I make a gump that appears when you die and gives the PC two choices: 1) remain at current location as a ghost, or 2) be teleported to a designated location and be ressurected.
If the PC selects option 2 from the gump, then the JS engine teleports the PC and ressurects him. I have no problem with this, and the teleport function seems to work with ghosts (through the add menu).
But how would I code the firing of this gump? In the globalscript under onDeathblow, but just make sure the target is a PC? Would that mess up the current death script?