LSValmont 789 Posted January 8, 2019 So my script starts like this: _Join_East = creategroup EAST; call { _changing = allUnits select {(side _x isEqualTo civilian) && (!isPlayer _x) && (_x distance player < 100)}; _changing apply { units _x joinSilent _Join_East; [_Join_East, _Pos_1] call BIS_fnc_taskAttack; // Now all nearby Ai civilians turn hostile to the player! And that works like a charm! What I need is to put this two waitUntil conditions into a single waitUntil with an OR. waitUntil {sleep 1; ({alive _x} count units _Join_East) < 3;}; waitUntil {sleep 1; player distance units _Join_East > 500}; I can't seem to get both to work in an OR format. The final result should be: waitUntil { (The _Join_East group has less than 3 units) OR (The player got 500 meters away from the units in the _Join_East group). Thanks in advanced! Share this post Link to post Share on other sites
Dedmen 2716 Posted January 8, 2019 waitUntil {sleep 1; ({alive _x} count units _Join_East) < 3 || player distance units _Join_East > 500}; distance units makes no sense though. distance doesn't take an array of units. 9 minutes ago, LSValmont said: I can't seem to get both to work in an OR format. I can't even get the second one to work seperately. Chose one unit of that group. And check the distance to that one. 2 Share this post Link to post Share on other sites
LSValmont 789 Posted January 8, 2019 15 minutes ago, Dedmen said: waitUntil {sleep 1; ({alive _x} count units _Join_East) < 3 || player distance units _Join_East > 500}; distance units makes no sense though. distance doesn't take an array of units. I can't even get the second one to work seperately. Chose one unit of that group. And check the distance to that one. Thanks Dedmen! Would this work: waitUntil {sleep 1; ({alive _x} count units _Join_East) < 3 || player distance leader _Join_East > 500}; ? PS: I never knew that || meant OR 2 Share this post Link to post Share on other sites
Dedmen 2716 Posted January 8, 2019 1 minute ago, LSValmont said: PS: I never knew that || meant OR https://community.bistudio.com/wiki/or 1 minute ago, LSValmont said: Would this work: yeah. Can't see anything wrong. Might need to add some more parenthesis. I prefer less parenthesis though. 1 Share this post Link to post Share on other sites
LSValmont 789 Posted January 8, 2019 2 hours ago, Dedmen said: yeah. Can't see anything wrong. Might need to add some more parenthesis. I prefer less parenthesis though. Just tested it and works like a charm! Thank you! Share this post Link to post Share on other sites