This takes math and I am not particularly good at math, so I searched your question through Google to see if it was already solved by someone else in the past - chances are it was, because this is actually a common question - and good news friend, it was!
Right, so the solution can be found in this DevForum post. Have a look if you can. To summarize, all you need to do is copy-paste two functions into your code:
02 | return string.format( "i" , Int) |
05 | function convertToHMS(Seconds) |
06 | local Minutes = (Seconds - Seconds% 60 )/ 60 |
07 | Seconds = Seconds - Minutes* 60 |
08 | local Hours = (Minutes - Minutes% 60 )/ 60 |
09 | Minutes = Minutes - Hours* 60 |
11 | return Format(Hours).. ":" ..Format(Minutes).. ":" ..Format(Seconds) |
The two above functions can be used to format any given amount of seconds into the h:m:s format you're looking for. Put them at the top of your script.
With that done, simply format the number of seconds remaining using the convertToHMS()
function every time a second is subtracted. It would look like so:
1 | for i = drtime, 1 , - 1 do |
2 | Lower.Text = convertToHMS(i) |
Et voila. Your script now should count down from 21600 seconds, or 6 hours, in the appropriate format, making for the daily reward system you desire.
Be sure to mark my answer as the solution (with the green checkmark) if this works for you! If it doesn't work, let me know with a comment and I will see if there is something I missed. :)