UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How to End Game after X rounds?

broken avatar :(
Created 9 years ago
by Letrix
0 Members and 1 Guest are viewing this topic.
2,109 views
broken avatar :(
×
broken avatar :(
Location: ar
Date Registered: 24 September 2014
Last active: 8 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Letrix's Groups
Letrix's Contact & Social Links
Hi. I have that question: How to End Game after X rounds?
When you get to spend X rounds the game automatically ends the game.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 5 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Code Snippet
Plaintext
rounds = 5 // How ever many rounds you want the players to spend
if(level.round_number == rounds)
level notify( "end_game" );
Marked as best answer by Letrix 9 years ago
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 years ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
Depending on where you put it, you might need to use a while function.

Code Snippet
Plaintext
end_at_round(round)
{
while(1)
{
if(level.round_number == round)
{
level notify( "end_game" );
break;
}
wait(.05);
}
}

At the top of the script, under main(), put:

Code Snippet
Plaintext
level thread end_at_round(2);

Make sure to change the round from the function call to the round number you want the game to end at
Last Edit: January 15, 2016, 03:10:36 am by jbird
broken avatar :(
×
broken avatar :(
Location: ar
Date Registered: 24 September 2014
Last active: 8 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Letrix's Groups
Letrix's Contact & Social Links
Depending on where you put it, you might need to use a while function.

Code Snippet
Plaintext
end_at_round(round)
{
while(1)
{
if(level.round_number == round)
{
level notify( "end_game" );
break;
}
wait(.05);
}
}

At the top of the script, under main(), put:

Code Snippet
Plaintext
level thread end_at_round(2);

Make sure to change the round from the function call to the round number you want the game to end at

The script works. Thanks for the help.

 
Loading ...