generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Would I use table concat to make a timer like this?

Previous Thread :: Next Thread 
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
28 Jun 2014 01:03 PM
1:30

1 = minutes
30 = seconds
Report Abuse
Goulstem is not online. 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 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
28 Jun 2014 01:05 PM
So how would I do this?
Report Abuse
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
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 is not online. 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 is not online. 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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
28 Jun 2014 01:10 PM
I'll post it. Give me a minute to find it.
Report Abuse
Goulstem is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image