Spriterfight 10 Posted July 28, 2020 I have been making a surrender script but i am stuck with this part _groups = allgroups select { count (units _x) < 3 ;}; _groupsselect = _groups select 0;//this is the part where i am stuck because i can select only one gorup,how can i sleect all groups form my array? { if (side _groupsselect == east) then { { _x setCaptive true; _x action ["Surrender", _x]; } forEach units _groupsselect; }; } forEach allGroups; So i want that every group surrender if their unit count drops below 3 but i cant get the allgroup working correctly and i dont understand it.How can i loop the allgroup array to make the units surrender? Share this post Link to post Share on other sites
gc8 977 Posted July 28, 2020 maybe you mean this: _groups = allgroups select { count (units _x) < 3 }; { _groupsselect = _x; if (side _groupsselect == east) then { { _x setCaptive true; _x action ["Surrender", _x]; } forEach units _groupsselect; }; } forEach _groups; 1 Share this post Link to post Share on other sites
Spriterfight 10 Posted July 28, 2020 20 minutes ago, gc8 said: maybe you mean this: _groups = allgroups select { count (units _x) < 3 }; { _groupsselect = _x; if (side _groupsselect == east) then { { _x setCaptive true; _x action ["Surrender", _x]; } forEach units _groupsselect; }; } forEach _groups; Thank you very much! Share this post Link to post Share on other sites