Countdown with timer


I’m not so much experienced in GLua, but I’m making something for a friend, and I need to know how to make a countdown with a timer. (timer.Simple would be great)
I want the countdown to be displayed on a hud (obviously it’ll be in a variable). I was thinking of making something like this (with a timer.Create), but I think that this is just a dumb code ‘-’.

– Don’t judge this code please !

cdValue = 100

function cdown()
cdValue = cdValue - 1
if cdValue == 0 then

timer.Create( “cdTimer1”, 1, 100, function() cdown() end )

That’s the code I wanted to make first… but I’ll prefer a timer.Simple.
Thanks !

Try using CurTime()
Here is the wiki page.
Just checked and it also features a counter

Just create a timer and use


Thanks for the reply.