Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I implement this?

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

2 answers

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.