This script instantly changes HP because it's an animation script – it happens during a single frame of the animation.
If you want it to work periodically, you need to change the script and its type.
Save this as "healing.c" inside the scripts folder and callit from your character's header
script data/scripts/healing.c
C-like:
void main(){
void self = getlocalvar("self"); //Get calling entity.
void health = getentityproperty(self,"health"); //get health
int time = openborvariant("elapsed_time");// get time
if ( time % 600 == 0 && getentityproperty(self, "exists") && !getentityproperty(self, "dead"))
{
changeentityproperty(self, "health", health+5);//add health
}
}
not to be rude here or nagging here, but I do not know how to make that work. I saved it as heal.c but the script im already using doesnt look like its using anything other than what I showed here. I dont even know how that script is working.
This works:
@script
void self = getlocalvar("self"); //get the self var
void power = getentityproperty(self,"mp"); // get target's current mp
changeentityproperty(self, "mp", power+10);
@end_script
but changing that to this:
@script
void self = getlocalvar("self"); //get the self var
void health = getentityproperty(self,"health"); // get target's current hp
changeentityproperty(self, "health", health+10);
@end_script
Just crashes the game. The few time I got it to not crash the game, the mp worked but it still didnt restore hp.
Also this is the whole animation:
anim run
@script
void self = getlocalvar("self"); //get the self var
void health = getentityproperty(self,"health"); // get target's current hp
changeentityproperty(self, "health", health+10);
@end_script
loop 1
delay 8
offset 80 129
bbox 60 93 20 40
frame data/chars/ken/run00.gif
frame data/chars/ken/run01.gif
frame data/chars/ken/run02.gif
frame data/chars/ken/run03.gif
frame data/chars/ken/run04.gif