I was wondering how I could make a countdown, using a GUI to look like this: 0:10 0:09 0:08
Instead of,
10 9 8
Here is the code I have so far, if you can please send snippets of code I could use to implement this feature. Thank you!
Timer Code:
function intermissionCountdown() if game.Players.NumPlayers >= 2 then for countDown = 10, 0, -1 do playerNotification('Intermission!') playerCountdown('0:'..countDown) wait(1) end end end
Sadly, I can't show you the code directly, because the site removes the formatting stuff for some reason. I made pastebin links with the code snippets in them.
Use string.format with the integer specifier.
Using above, we can make the string you wanted:
And if we put this in the timer code:
String formatting guide: http://wiki.roblox.com/index.php?title=Format_string
Create a simple conditional to check to see if the value is greater than 9
function intermissionCountdown() if game.Players.NumPlayers >= 2 then for countDown = 10, 0, -1 do playerNotification('Intermission!') if countDown > 9 then -- Check to see if "countDown" is greater than 9 playerCountdown('0:'..countDown) -- If it is, then it will go in as '0:10' else -- If it does not then... playerCountdown('0:0'..countDown) -- It will come out as '0:09', '0:08', etc end wait(1) end end end
Try that out and let me know how it works!