|
| 23 Aug 2011 06:06 PM |
How would I format 180 seconds (3 minutes) into this:
3:00 2:59 2:58 etc... 1:37 1:36 etc... 0:45 0:44 etc... 0:00
I would like to have something like...
time = 160
and then a function to formatt 160 in minutes:seconds
How? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:09 PM |
time = 0
for i = 180, 1, -1 do time = i/60 wait(1) end
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:10 PM |
Ever tried taking a look in the Time plugin? They show you how there. Anyways I think you could use this:
time = 180 while true do min = time/60 seconds = 0 local time = min..":"..seconds if seconds == 0 then min = min - 1 seconds = 59 else seconds = seconds - 1 end wait(1) end |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:11 PM |
| I think I just failed there O.o |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Aug 2011 06:12 PM |
Lol. Mine was so much shorter. :P
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:13 PM |
local h = Instance.new("Hint", workspace) time = 0
for i = 180, 1, -1 do time = math.floor(i/60) h.Text = ""..time wait(1) end
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:17 PM |
Here's my clock script.
local min = 0 local hours = 0 local sec = 0
local msg = Instance.new("Hint", workspace)
while wait(1) do sec = sec + 1 if sec == 60 then sec = 0 min = min + 1 if min == 60 then min = 0 hours = hours + 1 end end msg.Text = ""..hours.." : "..min.." : "..sec.."" end
That may not work, I made that a long time ago when I was a bad coder. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:27 PM |
Thanks guy's for all the help but I still haven't gotten it.
The only problem I can't seem to fix is that it goes from 1:10 to 1:9
I would like i tto go to 1:09
Anyone got a script now? |
|
|
| Report Abuse |
|
|
| |
|