Baconator 1 Posted September 15, 2014 i couldnt find it in/understand the waitUntil wiki, so i thought i would ask. Does waitUntil exit after the first true boolean it sees or does it keep executing the code block? example: _var = 1; waitUntil { if (_var == 0) exitWith {true;}; if (_var == 1) exitWith {true;}; if (_var == 2) exitWith {true;}; false; }; so the code block in the waitUntil would look like this after evaluating the conditional statements: waitUntil { false; true; false; false; }; would the waitUntil end at the first true or does the last value need to be true? :confused: Share this post Link to post Share on other sites
iceman77 19 Posted September 15, 2014 (edited) It'd exit the current scope (waitUntil?). I'd suggest lazy evaluation instead of the 'ifs' / exitWith. waitUntil {_var == 0 || {_var == 1 || {_var == 2}}}; //Will stop evaluating and go on with the script as soon as any one of the conditions returns true. //other stuff Edited September 15, 2014 by Iceman77 Share this post Link to post Share on other sites
Baconator 1 Posted September 15, 2014 ok thats what i thought, but i just wanted to make sure. Thank you. As for the lazy evaluation, I'm gonna wait to optimize until i get the mission actually working first lol might save myself a few grey hairs. Share this post Link to post Share on other sites
killzone_kid 1333 Posted September 15, 2014 The last value of waitUntil scope has to return true. Using exitWith {true} essentially does that too. Share this post Link to post Share on other sites