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 do I make it something in my script doesn't activate until a certain round?

broken avatar :(
Created 5 years ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
1,278 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
Hey guys! Just as the title says, I am wondering how to make it so that something in my script does not happen until a certain round has been passed. I am sure it is something simple, but I am newer to scripting so I am unsure how to do this. Any help is much appreaciated!
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 24 September 2016
Last active: 3 years ago
Posts
144
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
ZombieSlayerr115
Signature
Please. Save me.
×
isaacscott935's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
isaacscott935's Contact & Social LinksZombieSlayerr115isaac935
Code Snippet
Plaintext
if( level.round_number >= 10 )
{
    thread your_function;
}
Put the code above in the main() function of your script.
Replace ‘10’ with the round you want your script to be used.
Replace ‘your_function’ with the name of your function. 
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 2 January 2015
Last active: 3 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Beginner mapper trying to make something for the community to enjoy
×
ihmiskeho's Groups
ihmiskeho's Contact & Social Linksihmiskeho
Untested but should work
Code Snippet
Plaintext
function YOUR_FUNCTION_NAME()
{
level endon(”end_game”);

while(1)
{
level waittill(”start_of_round”);
if(level.round_number >= x) //Change x to round number
{
//Add a function or add other stuff here
break;
}

}
}
Replace YOUR_FUNCTION_NAME with whatever you want.
Code Snippet
Plaintext
if( level.round_number >= 10 )
{
    thread your_function;
}
Put the code above in the main() function of your script.
Replace ‘10’ with the round you want your script to be used.
Replace ‘your_function’ with the name of your function.
This would need a while loop in order to work. Otherwise it check the round number only when this function is called. This means that if the round is not right, nothing will happen and the function stops.
Last Edit: January 11, 2019, 03:49:06 pm by ihmiskeho
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 24 September 2016
Last active: 3 years ago
Posts
144
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
ZombieSlayerr115
×
isaacscott935's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
isaacscott935's Contact & Social LinksZombieSlayerr115isaac935
Yeah, i literally haven't scripted in a while so i am very rusty

 
Loading ...