Jump to content

Make a countdown?


Recommended Posts

local countdownMS = getTickCount() + 86400000 
  
function getTimeMS(ms) 
    local hours = math.floor(ms/3600000) 
    ms = ms - hours * 3600000 
    local minutes = math.floor(ms/60000) 
    ms = ms - minutes * 60000 
    local seconds = math.floor(ms/1000) 
    return hours,minutes,seconds 
end 
addEventHandler("onClientRender",root,function() 
    local h,m,s = getTimeMS(countdownMS-getTickCount()) 
    dxDrawText("Hours: "..h.." Minutes: "..m.." Seconds:"..s,100,100) 
end) 

I think this should be what you mean, haven't tested it so it might contain buggs.

Link to comment
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...