Hey guys, i was trying to make a countdown timer but i don't know where to start. Any tips? I want it to pop up on the screen. Also, i was thinking of maybe copying a bit of the arrested countdown code. Idk if that would work but i would like some in put.
Depends on what you need.
If it's a clientside only timer, use [url=http://wiki.garrysmod.com/page/Global/CurTime]this function[/url], save it in a variable clientside, then use a hook such as HUDPaint or Think to update the timer.
To get the time in seconds, all you have to do is substract the stored time from the current time and you will get a timer that counts up. If you want something to count down, (i.e., I want something to happen in 30 seconds but also show the timer, rather than using timer.Simple()), store the CurTime() + 30 in a local variable, then substract the current time from the variable you stored, and you'll get a positive number counting down.
Sorry, you need to Log In to post a reply to this thread.