Jump to content
Flash-Ranger

Healing System not working when legs are hit

Recommended Posts

Hello,

 

For some reason, my Healing system is not working when the player's legs are hit ..........

 

Can someone help ?

While {True} Do
    {
    WaitUntil {Alive Player;};
    Sleep 1;
    While {(damage player) < 0.1} Do
        {
        Sleep 1;
        };
    Heal_Act = Player AddAction ["<img size='1.0' color='#FFFFFF' image='Images\heal_ca.paa'/>","Heal_System\Action.sqf",[],-100,False,True,"",""];
    Player SetDamage 0.26;
    While {(Damage Player != 0.25) And Alive Player} Do
        {
        Sleep 0.1;
        };
    Player SetDamage 0;
    Player RemoveAction Heal_Act;
    };

 

Share this post


Link to post
Share on other sites
Just now, Flash-Ranger said:

Still need Help please !

Please don't bump threads.

Share this post


Link to post
Share on other sites

Not sure what you want to achieve with your script above but:

 

Player AddAction ["<img size='1.0' color='#FFFFFF' image='Images\heal_ca.paa'/>",{player setdamage 0;},[],-100,False,True,"","alive player && (damage player != 0)"];

(written on phone so may have syntax errors)

Should give the player an action, if he has damage to heal himself completely.

  • Like 1

Share this post


Link to post
Share on other sites

Do you have any idea why my script doesn't work when legs are hit or damaged ?

Share this post


Link to post
Share on other sites

This snippet is weird at most.

The conditions don't make any sense whatsoever.

First you wait in a loop until the player is damaged more than 0.1,

then you add the action which will execute "Heal_System\Action.sqf" when called, whatever that is,

then you set the players damage to 0.26 and wait until it's not 0.25

 

I don't get what you're trying to achieve here.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

I'm trying to enable the player to heal himself each time he gets hit.

 

The action give's him accès to a healing action that heals him completely. This works perfectly ... except when the legs are hit.

Share this post


Link to post
Share on other sites

Why not simply:

player addAction ["Heal yourself!",{(_this select 0) setdamage 0},[],-100,False,True,"","_target isEqualTo _this and _target isEqualTo vehicle _target AND damage _target > 0"];

Why so complicated?

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Right but will this activate each time _This is damaged ? Or only once until he dies ?

Share this post


Link to post
Share on other sites
1 hour ago, Flash-Ranger said:

Right but will this activate each time _This is damaged ? Or only once until he dies ?

You stated that you wanted the player to heal himself each time he gets hit,

so that's what my snippet does.

 

Cheers

Share this post


Link to post
Share on other sites

Mine worked as well, the only problem with mine was that it did't enable the action when the LEGS are hit ...

Share this post


Link to post
Share on other sites

Works Perfectly !!

 

Final version : 

 

player addAction ["<img size='1.0' color='#FFFFFF' image='Images\heal_ca.paa'/>",{Player Action ["HealSoldierSelf", Player];player setDamage 0;},[],-100,False,True,"","_target isEqualTo _this and _target isEqualTo vehicle _target AND damage _target > 0"];

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×