Play3r 147 Posted May 11, 2019 I have this little script i found in a old TXT file i found, i wanted to use it in my game but i can't get it to work, I Believe that it is counting the civilian that i kill in the game and when i get over 1 killed it will end the game, but i have to kill all the civilian in the game to make the game end. if i put 8 in the game i have to kill all 8 before the game ends, i want the game to end if i only kill 1 civilian. Does anyone have the solution for me to my problem. The txt is in my INIT.SQF [] spawn { while {true} do { sleep 3; _cnt = { side _x == civilian } count allUnits; if (_cnt < 1) exitWith {"Loser" call BIS_fnc_endMission}; } } Share this post Link to post Share on other sites
Alert23 215 Posted May 11, 2019 14 minutes ago, Play3r said: I have this little script i found in a old TXT file i found, i wanted to use it in my game but i can't get it to work, I Believe that it is counting the civilian that i kill in the game and when i get over 1 killed it will end the game, but i have to kill all the civilian in the game to make the game end. if i put 8 in the game i have to kill all 8 before the game ends, i want the game to end if i only kill 1 civilian. Does anyone have the solution for me to my problem. The txt is in my INIT.SQF [] spawn { while {true} do { sleep 3; _cnt = { side _x == civilian } count allUnits; if (_cnt < 1) exitWith {"Loser" call BIS_fnc_endMission}; } } hey, i found this: 1 Share this post Link to post Share on other sites
Play3r 147 Posted May 11, 2019 26 minutes ago, Alert23 said: hey, i found this: THX that did it, funny i didn't find it when i did my search.. 1 Share this post Link to post Share on other sites
pierremgi 4886 Posted May 12, 2019 Just note that for any killed, as the corpse become civilian, you must use its group: (side group _killed, instead of side _killed). A dead will leave its group after some seconds but it's ok when you apply an event handler. Share this post Link to post Share on other sites
Tankbuster 1746 Posted May 12, 2019 I'd get its faction rather than its group or use bis_fnc_sideid Share this post Link to post Share on other sites
l4ndl0rd 11 Posted July 29, 2019 On 5/11/2019 at 10:02 PM, Play3r said: _cnt < 1 The reason why it ends when you killed all civilians is this, you check how many are alive and if the number drops below 1 then you end the mission. 1 Share this post Link to post Share on other sites