How to use "ondeathscript"?

I want my character not to die after falling into the abyss. I used "jeblos.c" from TMNT rescure palooza, but the script doesn't work. Please tell me how to fix this.
 
Oh that jeblos.c is used together with other scripts.

I shared it in latest Map Demo some time ago, to demonstrate how to change falling to hole into regular damage.

You need to use another script called jeblosA.c and declared with this:
Code:
onmoveascript            data/scripts/jeblosA.c

and another one in character's RESPAWN/SPAWN animation like this:
Code:
anim spawn
@script
 if(frame == 1){
   void self = getlocalvar("self");
   int PIndex = getentityproperty(self,"playerindex");
   int HPs = getglobalvar(PIndex+"HPs");

   if(HPs!=NULL()){
     changeentityproperty(self, "health", HPs);
     setglobalvar(PIndex+"HPs", NULL());
   }
 }
@end_script
...
 
Oh that jeblos.c is used together with other scripts.

I shared it in latest Map Demo some time ago, to demonstrate how to change falling to hole into regular damage.

You need to use another script called jeblosA.c and declared with this:
Code:
onmoveascript            data/scripts/jeblosA.c

and another one in character's RESPAWN/SPAWN animation like this:
Code:
anim spawn
@script
 if(frame == 1){
   void self = getlocalvar("self");
   int PIndex = getentityproperty(self,"playerindex");
   int HPs = getglobalvar(PIndex+"HPs");

   if(HPs!=NULL()){
     changeentityproperty(self, "health", HPs);
     setglobalvar(PIndex+"HPs", NULL());
   }
 }
@end_script
...
This explains a lot.

Thank you very much, I finally got it done. I have only one question, who is the author of this script? Who should I mention in the credits?
 
Back
Top Bottom