badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 28 Jun 2014 01:03 PM |
1:30
1 = minutes 30 = seconds |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 28 Jun 2014 01:04 PM |
| I've actually made a timer like this.. If you want it then say so but, uhm.. no you wouldn't because that wouldn't make any sense. |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
| |
|
|
| 28 Jun 2014 01:06 PM |
| You can, but there's other ways to go about it as well. I made one, and mine consisted of about 3 conditional statements. |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 28 Jun 2014 01:06 PM |
| So how could I make on? Can someone help? |
|
|
| Report Abuse |
|
|
Reqkt
|
  |
| Joined: 17 Jun 2014 |
| Total Posts: 210 |
|
|
| 28 Jun 2014 01:10 PM |
time = { hours = '00'; minutes = '01'; seconds = '30' }
table.concat(time, ':') |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 01:10 PM |
| I'll post it. Give me a minute to find it. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 28 Jun 2014 01:12 PM |
Well I'll show you mine..
function CountDown(tot) h = Instance.new("Hint",game.Workspace) for i = tot,0,-1 do local Min = math.floor(i/60) local Sec = i-(60*Min) h.Text = Min..":"..Sec wait(1) end h:Destroy() end
function CountDown(minn,sec) h = Instance.new("Hint",game.Workspace) local tot = ((minn*60)+sec) for i = tot,0,-1 do local Min = math.floor(i/60) local Sec = i-(60*Min) h.Text = Min..":"..Sec wait(1) end h:Destroy() end
It can be called as;
CountDown(2,17) --2 minutes and seventeen seconds
or;
CountDown(137) --It splits it up, 2 minutes and seventeen seconds |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 28 Jun 2014 01:13 PM |
| I don't know of a way that you could use table.concat and it would make any sense or be very free of options to manipulate it to your needs.. |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 28 Jun 2014 01:22 PM |
I'm using this for a minigame timer.
I don't want like 50 different functions, is there any short ones? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 28 Jun 2014 01:25 PM |
| Lol that was two, and they both do the same thing just one you put your minutes and seconds and ther other you just put the seconds and it splits it up. Extremely efficient for a timer. Stop being whiney because it's long. A short ones not going to be as good. |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 28 Jun 2014 01:28 PM |
OK, I edited it. This works fine. Thanks!
for i = timee,0,-1 do local Min = math.floor(i/60) local Sec = i-(60*Min) h.Value= Min..":"..Sec wait(1) end |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2014 01:28 PM |
Found mine, but it's extremely inefficient in the way I wrote it, as I made it such a long time ago. I guess it could serve of some use (maybe).
function countDownTheTime(minutes,seconds,rateTotal) local secondsleft = seconds local minutesleft = minutes local time_string = minutes..":"..seconds for i = 1,rateTotal do print(time_string) wait(1) if minutesleft>0 and secondsleft>0 then secondsleft = secondsleft-1 elseif minutesleft>0 and secondsleft==0 then minutesleft = minutesleft-1 secondsleft = 59 elseif minutesleft==0 and secondsleft>0 then secondsleft = secondsleft-1 end if minutesleft>0 and secondsleft>9 then time_string = minutesleft..":"..secondsleft elseif minutesleft>0 and secondsleft<10 then time_string = minutesleft..":0"..secondsleft elseif minutesleft==0 and secondsleft>9 then time_string = "0"..minutesleft..":"..secondsleft elseif minutesleft==0 and secondsleft<10 then time_string = "0"..minutesleft..":0"..secondsleft end end end
countDownTheTime(1,30,90) |
|
|
| Report Abuse |
|
|