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 make a timer

broken avatar :(
Created 12 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
1,663 views
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
how do i make a countdown timer, i dont want it to be a hud element either
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Hopefully this is what you want it starts at 60, in this case, goes down and once it hits 0 it will continue the rest of the code.
Code Snippet
Plaintext
i = 60; for( ;; ) { wait 1; i--; if ( i == 0 ) break; } // Continue Function
or
Code Snippet
Plaintext
 i = 60; while( i > 0 ) { wait 1; i--; }
Edit: Reading this over I don't think this is what you want but idk.
Last Edit: June 22, 2014, 12:35:46 am by PROxFTW
Marked as best answer by Deleted User 8 months ago
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
as an alternative...

Thread this when you want the timer to init:

Spoiler: click to open...
Code Snippet
Plaintext
timer_init(time, type, value, variable)
{
if(isdefined(time) && isdefined(type) && isdefined(value) )
{
wait(time);

switch(type)
{
case "notify":
level notify(value);
break;

case "flag":
flag_set(value);
break;

case "variable":
variable = value;
break;
}
}
else
{
iprintln("One of the following is not defined: Time, Type, Value!");
}
}

create either a waittill(), flag_wait(), or if(var == value) somewhere in your script. Then pass whatever you need through the function.

Like this:
Code Snippet
Plaintext
timer_init(20, "notify", "door_open")

Haven't tested it but i don't see why it wouldn't work.

edit: notify wasn't a string. fixed.
Last Edit: June 22, 2014, 12:42:21 am by daedra descent
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
never mind. my own ignorance completely forgot about the wait function. # blond moment. sorry. but i did test both of ur methods and will mark the best answer. his was the best because it fitted my need without having any rescripting.
Last Edit: June 22, 2014, 01:28:55 am by n123q45

 
Loading ...