Goro 21 Posted February 8, 2016 Hello there. I'm trying to make a script that will make all OPFOR soldiers to die with only headshot. The script needs to be instantly checked, because the soldiers spawn during the mission. Thanks in advance! Share this post Link to post Share on other sites
jshock 513 Posted February 8, 2016 https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage Share this post Link to post Share on other sites
Goro 21 Posted February 9, 2016 Can't get the script working, anyone? while {alive player} do { if (_x side == "EAST") then {_x addEventHandler ["HandleDamage", {if (_this select 1 in ["head_hit"]) then {_this select 2}}]}; sleep 0.1; }; Share this post Link to post Share on other sites
jshock 513 Posted February 9, 2016 On my phone, so this is pseudo, but when the event handler executes: if !(isPartHead) then { 0; } else { 1; (or return damage dealt) };Also, why the loop? The EH, once applied doesn't need to be applied again, also "_x" won't work unless you have it all wrapped in a forEach loop. Share this post Link to post Share on other sites
Goro 21 Posted February 9, 2016 Well, the soldiers will spawn later, so I think I needed to loop that. Share this post Link to post Share on other sites
Goro 21 Posted February 9, 2016 Now I've got something like this: while {alive player} do {{ _x addEventHandler ["HandleDamage", {if !(isPartHead) then { 0; } else { 1; };} } forEach units east; sleep 0.1;}; Still, doesn't work. Share this post Link to post Share on other sites
jshock 513 Posted February 9, 2016 Like I said, my code was psuedo (meaning it's the concept not actual code), isPartHead isn't a command, and if you loop through all east units every tenth of a second your loop will be extrnemly heavy and every alive east unit will have a lot of handleDamage EHs. I can't provide proper code atm from my phone, so hopefully someone else can assist in this matter. Share this post Link to post Share on other sites