Jump to content
Sign in to follow this  
Alert23

Prevent vehicle/unit from being destroyed/killed but still take damage

Recommended Posts

hi everyone,

so i know that there are many scripts out there which can simulate what i try but somehow for what reason ever (at least i dont understand 🤷‍♂️),

the scripts are not 100% preventing vehicle/unit from getting destroyed/killed.

im trying to stop the damage of a vehicle/unit at 0.9 so i can execute a custom MissionFailed.sqf if the vehicle/unit has 0.9 damage letting him then decide wheter to continue or quit the mission.

 

this is what im using right now sometimes it does work but then sometimes not.


 

SARO_global_damage = 0;


d = vehicle player addEventHandler ["handleDamage",   
{  
 _dmg  = _this select 2;
 
 SARO_global_damage = SARO_global_damage + ( _dmg - SARO_global_damage) * 0.02;
 
 if (SARO_global_damage > 0.9) then {0.9} else {SARO_global_damage};
}];

is there a way to 100% ensure the vehicle/unit from getting destroyed/killed?

Share this post


Link to post
Share on other sites

I don't know about your script. I used to put the damage to 0.9 in an ambush. The vehicles caught fire and exploded in a short time. Try changing the value 0.9 to 0.8 to see if it solves your problem

  • Thanks 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
Sign in to follow this  

×