I’d like to make a timer for game play, then have it log to a leaderboard.
I can make get minutes and seconds to work, but not milliseconds.
Any help would be great
[lua]
local function updateTime( event )
gameText.counterTenths = gameText.counterTenths + 1
gameText.minutes = math.floor( gameText.counterSeconds / 60 )
gameText.seconds = math.floor( gameText.counterTenths / 100 )
gameText.tenths = gameText.counterTenths % 100
gameText.timeDisplay = string.format( “%02d:%02d:%02d”, gameText.minutes, gameText.seconds, gameText.tenths )
gameText.clockText.text = gameText.timeDisplay
end
misc.counterTimer = timer.performWithDelay(1,updateTime, 0)
[/lua]