ArgosBigbayev
Member
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.
onmoveascript data/scripts/jeblosA.c
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.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 ...
Okay. Thank you all.@ArgosBigbayev: Bloodbane is the author of these fabulous scripts.