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
 

Formatting Seconds To Minutes and Seconds? Help!?

Previous Thread :: Next Thread 
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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
DigitalRunner is not online. DigitalRunner
Joined: 07 Aug 2011
Total Posts: 193
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
DigitalRunner is not online. DigitalRunner
Joined: 07 Aug 2011
Total Posts: 193
23 Aug 2011 06:11 PM
I think I just failed there O.o
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
23 Aug 2011 06:12 PM
Nope...
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
23 Aug 2011 06:12 PM
Lol. Mine was so much shorter. :P

-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->-
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
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
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
24 Aug 2011 06:35 AM
bump
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