jonipetteri 11 Posted April 17, 2019 Hello guys! Can someone tell me what is the command to reduce taken damage? (Or increase health?) And the other way around... What is the command to get it back to "normal"? I'm trying to make a bomb suit setup, when player is wearing certain vest_classname, he can take survive even from the biggest explosions of the game... Thanks in advance! Share this post Link to post Share on other sites
sarogahtyp 1109 Posted April 17, 2019 not tested but should reduce the damage to the half: _unit addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage"]; (_damage * 0.5) }]; 1 Share this post Link to post Share on other sites
Alert23 215 Posted April 17, 2019 6 hours ago, sarogahtyp said: not tested but should reduce the damage to the half: _unit addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage"]; (_damage * 0.5) }]; hi, i have a question related to this. i played a bit with your code to change it to my suiting but without success so my question is: how would i script it so that a unit would only survive 10 shots no matter which caliber. danke Share this post Link to post Share on other sites
jonipetteri 11 Posted April 18, 2019 18 hours ago, sarogahtyp said: not tested but should reduce the damage to the half: _unit addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage"]; (_damage * 0.5) }]; Tested this in init of the trigger in the editor. Didn't work. Alltough didn't throw any errors... Can you help with this? Am I missing something? Trigger: Any player Present On Activation: hint "Superhuman!"; _unit addEventHandler ["HandleDamage", {params ["_unit", "_selection", "_damage"];(_damage * 0.5)}]; Share this post Link to post Share on other sites
pierremgi 4923 Posted April 18, 2019 Normal. _unit doesn't mean nothing in your trigger. It's a little bit weird to activate this kind of EH in a trigger. Prefer player addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage"]; _damage = if (_unit inArea theTriggerNameYouWant) then [{_damage * 0.5},{_damage}]; _damage }]; 1 Share this post Link to post Share on other sites
jonipetteri 11 Posted April 18, 2019 2 hours ago, pierremgi said: Normal. _unit doesn't mean nothing in your trigger. It's a little bit weird to activate this kind of EH in a trigger. Prefer player addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage"]; _damage = if (_unit inArea theTriggerNameYouWant) then [{_damage * 0.5},{_damage}]; _damage }]; Not a professional, so I might be weird. Now the trigger is activated when player is wearing certain vest. Do you think it would be better to do this (MP) via script? Share this post Link to post Share on other sites
jonipetteri 11 Posted April 18, 2019 39 minutes ago, pierremgi said: Sure! Okay. If I run "[] execVM ""activate.sqf"";" in trigger activation and "[] execVM ""deactivate.sqf"";" in other trigger, do I have to run some kind of code to stop running the first script (activate.sqf)? Hope you understand what I'm trying to ask. Share this post Link to post Share on other sites
pierremgi 4923 Posted April 18, 2019 You don't need 2 triggers. Perhaps one for the area... and just a condition for your code in your event handler. Simple as that. The understanding effort is on your side. Share this post Link to post Share on other sites