simicsko 4 Posted February 20, 2023 Hi all! There is an enemy infantry group. What I want to do is that if I hit any enemy soldiers and their injury is higher than 0.8, for example, they should die. It would be important that the players are not affected. How to handle this event? Does anyone have any ideas? Share this post Link to post Share on other sites
cool=azroul13 14 Posted February 20, 2023 You can look at the "handledamage" eventhandler: Quote unit_affected addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"]; If !( isPlayer _unit) then { // check if the unit is not a player If (_damage > 0.8) then { // check damage _unit setdamage 1 //kill the unit }; }; }]; Something like that but I'm a bit rusted. 1 Share this post Link to post Share on other sites
simicsko 4 Posted February 20, 2023 3 hours ago, cool=azroul13 said: unit_affected addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"]; If !( isPlayer _unit) then { // check if the unit is not a player If (_damage > 0.8) then { // check damage _unit setdamage 1 //kill the unit }; }; }]; It works! Thank you very much; 😉 Share this post Link to post Share on other sites
simicsko 4 Posted February 21, 2023 My son and I (to avoid shooting soldiers) downloaded the Max Terminator MOD. Since you have to shoot a lot at these robots to destroy them, they are also too accurate, so I thought of this solution. So their accuracy is maintained, but they take fewer shots to destroy. This was the final solution: { _x addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"]; If (typeOf _unit == "Max_terminator_skeleton") then { If (_damage > 0.3) then { _unit setdamage 1}; }; } ]; }foreach allunits cool=azroul13, Thanks for your help! 😉 Share this post Link to post Share on other sites