Jump to content
Sign in to follow this  
Coffeecat

Respawn Limit for player

Recommended Posts

I allready found some stuff, however, for some reason its not working for me.

i want to limit live for player m1 to 3,third time death ends the mission.

in my Init.sqf:

m1Lives=3;

Trigger in Game:

Condition:

! (alive m1)

OnAct:

m1Lives=m1Lives-1;

Endtrigger Condition if 0 is reached for m1Lives:

m1Lives<=0;

OnAct:End1

what is wrong...?

Edited by Coffeecat

Share this post


Link to post
Share on other sites

In your init.sqf you need to add this after m1lives:

publicVariable "m1lives";

Now your trigger will know what m1lives is since it is now a publicVariable.

Share this post


Link to post
Share on other sites

Maybe something like this?

myRespawns = 0;

while {true} do {
   waitUntil {!alive player};
   if (myRespawns >= 3) then {endMission "END1"};
   waitUntil {alive player};
myRespawns = myRespawns + 1;
};

Share this post


Link to post
Share on other sites

Thanks. The publicVariable option worked, but somehow it stopped working then. using your script kyliana, many thx!

Edited by Coffeecat

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×