• Stopwatch / Timer going upwards
    1 replies, posted
I've got this script here; [CODE]timer.Create("Timer name", 10, 1, function() --Stuff goes here end) hook.Add("HUDPaint", "Paint_DrawTimer", function() if timer.Exists("Timer name") then draw.DrawText( string.ToMinutesSeconds(timer.TimeLeft("current_time")), "DermaLarge", 850, 5, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER ) end end)[/CODE] And I was wondering firstly how I put this into Formatted Time ( 00:00:00:00 ) instead of ToMinutesSeconds and how do I make it count up instead of down with 2 commands, stop and start. If you could help that would be brilliant. Thanks :D
Use [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/os/date"]os.date[/URL] and parameterize it properly to make it read properly As for counting upwards, invert the counter. Instead of using Counter - CurTime() record the opposite. So save a value when the timer was started and just work from there. ReSave each time and record every time it's stopped/started with the appropriate adjustments
Sorry, you need to Log In to post a reply to this thread.