# Thread: SP / Coop Mission - Respawn Question

1. ## SP / Coop Mission - Respawn Question

Im creating a small COOP/ SP Mission and i got 2 questions.
You should be able to play the mission alone, with the KI only OR up to 5 players.
1. If you play the mission alone, the KI should not respawn, how do i do this?
2. If you are playing with -5 human players, everbody should be able do die 3 times. If anybody died the third time, Game Over.
I would appreciate some help very much

I allready got the Respawn working with the description, i only need to solve the 2 probs.

2. Edited because I replied but then realised my answer was incorrect! I'm limited for time right now but will reply in a couple of hours!

3. I almost forgot...Is it also possible to make the players dead body dissapear after spawn easily? i dont want them to get the weapons and ammo back..

4. Ok you're going to want to first create a Game Logic inside the editor which reads:

Code:
```man1life = 3;
man2life = 3;
man3life = 3;
man4life = 3;
man5life = 3;```

Next, you'll want to put this into your init.sqf:
Code:
```if (!alive man2) AND (!alive man3) AND (!alive man4) AND (!alive man5) then {
if (man1 getDammage > 0.99) then {
endMission "END1";
} else {
null = execVM [] "getlife.sqf"};```

Finally, create an sqf called getlife.sqf with the following in:
Code:
```//Understanding if 'man1' has been killed, and takes away a life if he has
if (man1 getDammage > 0.99) then {
man1life = man1life - 1};
hideBody man1;
//Doing the same for 'man2' and so on
if (man2 getDammage > 0.99) then {
man2life = man2life - 1};
hideBody man1;
if (man3 getDammage > 0.99) then {
man3life = man3life - 1};
hideBody man1;
if (man4 getDammage > 0.99) then {
man4life = man4life - 1};
hideBody man1;
if (man5 getDammage > 0.99) then {
man5life = man5life - 1};
hideBody man1;

//If anybody's life count reaches 0, end the mission and go to "END1" (like in a trigger)
if (man1life == 0) then {
endMission "END1"};
if (man2life == 0) then {
endMission "END1"};
if (man3life == 0) then {
endMission "END1"};
if (man4life == 0) then {
endMission "END1"};
if (man5life == 0) then {
endMission "END1"};```

Run it all and that should all work, assuming that if you're playing singleplayer you'll be playing using 'man1'.
The stuff in init.sqf asks whether there's more than one player and, if there are, activates the respawn script. If there's only one player, it gives him one life before the mission ends.

To be perfectly honest, the whole system is pretty ham-handed and clunky, and I'm not even sure in the slightest that it will work, as I can't test anything at the moment.

Regardless, give it a whirl and tell me what happens! xD

Hope I helped a bit at least! I'm still learning as well!

5. Thanks for trying to help, but sadly nothing of this worked^^
The dead bodies dont dissapear, neither is the mission ended after 3 respawns.
I thought about a killed evanhandler, but i dont know how to combine it with a count of 3 times players dead.thanks

6. You could use norrins revive script which essentially allows you to limit number of revives you get and other players.

7. Yea, well.
I just got the BIS First Aid Modules running good with respawn and i like them more, so i need a other solution..

8. Push

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•