Alert23 215 Posted April 28, 2018 Hey Guys, i have here a script which should force the AI to Choose between [ setUnitPos "UP" and setUnitPos "MIDDLE" ] and prevent the AI from Prone. but somehow it dosent work. { if (side _x == resistance) then { _Stance = ["UP", "MIDDLE"]; {_x setUnitPos _Stance select (floor random 2)} }; } forEach allUnits; maybe im doing something wrong could you pls help. Share this post Link to post Share on other sites
7erra 629 Posted April 28, 2018 On 4/28/2018 at 10:57 AM, Alert23 said: {_x setUnitPos _Stance select (floor random 2)} This part won't be executed. Leave out the brackets: { if (side _x == resistance) then { _x setUnitPos (selectRandom ["UP", "MIDDLE"]); }; } forEach allUnits; 1 Share this post Link to post Share on other sites
Alert23 215 Posted April 28, 2018 On 4/28/2018 at 11:16 AM, 7erra said: This part won't be executed. Leave out the brackets: { if (side _x == resistance) then { _x setUnitPos (selectRandom ["UP", "MIDDLE"]); }; } forEach allUnits; thank you this works. Share this post Link to post Share on other sites