Cigs4 18 Posted January 26, 2021 Hello!! I did a mission with some animations created via remoteExec and others I removed the "PATH", all on a dedicated server. What I'm trying to do is when an AI gets shot or someone fires nearby, it exits the animation and engages the enemy. So, I tried this: if (side _x isEqualTo EAST) then { _x addMPEventHandler ["MPHit", { (_this select 0) enableAI "PATH"; [(_this select 0),""]remoteExec["switchmove"]; (_this select 0) setUnitPos "UP";}]; } forEach allUnits; if (side _x isEqualTo EAST) then { _x addEventHandler ["FiredNear", { (_this select 0) enableAI "PATH"; [(_this select 0),""]remoteExec["switchmove"]; (_this select 0) setUnitPos "UP";}]; } forEach allUnits; But no sucess... I don't know what I'm doing wrong or if I did something right at all. Please, help! Thanks in advance. Share this post Link to post Share on other sites
pierremgi 4739 Posted January 27, 2021 your code is clunky. You can't start a condition if then and finish the scope by forEach. These are two different things: { _x (element here) ...} forEach an array; if (something true) then {a code}; { call { if (side _x isEqualTo EAST) exitWith { _x addMPEventHandler ["MPHit", { (_this select 0) enableAI "PATH"; [(_this select 0),""]remoteExec["switchmove"]; (_this select 0) setUnitPos "UP"; }]; }; if (side _x isEqualTo EAST) exitWith { _x addEventHandler ["FiredNear", { (_this select 0) enableAI "PATH"; [(_this select 0),""]remoteExec["switchmove"]; (_this select 0) setUnitPos "UP"; }]; }; }; } forEach allUnits; Note: it's just a way to code, on your basis, not saying you will obtain the perfect intended result using this commands. 1 Share this post Link to post Share on other sites
killzone_kid 1326 Posted January 27, 2021 1 hour ago, pierremgi said: addMPEventHandler MP EH fires on every PC you dont need or want to use remote exec in it 2 1 Share this post Link to post Share on other sites
Cigs4 18 Posted January 28, 2021 Thank you very much for the answers and the correction. Really helpful. I will dig a little more about this, but if anyone knows something else, I would really appreciate any help. 1 Share this post Link to post Share on other sites