lbarsize not full

Steven1985

Active member
Hi, in levels.txt there is:
lbarsize 75 3 0 1 0 0 0 0 0
If the player has health 100, is it possible to spawn it with 40 HP lost? (lbarsize not full)
Thank you in advance.
 
You can force player (or any entity) to spawn with less health with script. This is an example of such script declared in a level:
Code:
spawn    delay
@script
void main()
{
    void P1 = getplayerproperty(0, "entity");

    if(P1){
      changeentityproperty(P1, "health", 10);
    }
}
@end_script
health    20
coords    320 460
at    0

When this delay is spawned, player 1 will have 10 units of health.
 
for npcs has I to do so?
C-like:
spawn Kassar_
@script
void main()
{
    void self = getlocalvar("self");

    if(self){
        changeentityproperty(self, "health", 40);
    }
}
@end_script
coords 400 460
at 5
 
Back
Top Bottom