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

Countdown script, numbers not showing?

Hello! I made this countdown script with the help of BOF, but it dosnt work anyways. So is there a way to get it to work? It doesnt show the numbers when I put while true

while true do
wait(1)
for i = 30,0,-1 do
wait(1)
script.Parent.Text = math.floor(i)
wait(60)
end

2 answers

✓ Accepted answer

Instead of using math.floor, I recommend doing this:

while true do
wait(1)
	for i = 30,0,-1 do
	script.Parent.Text = "Intermission: "..i
	wait(1)
	end
end

2 comments

0

I used that before, it didnt work properly. But I already got the script to work :V

0

Then accept the answer q.q

No.1 Use indents so that the code is cleaner

No.2 You don't need the wait that's straight after the while true do.

No.3 Make sure you think about what your code is doing.

No.3 Make sure you end the block with the while true do.

You didn't need to use math.floor because the script is controlling the for loop's increments anyways.(All it'd do is make it increment another time, when it isn't needed because the third number in the for loops declaration controls that)

Other than that, just make sure you don't add any unnecessary waits because they're not useful and just make the thread slow down even more.

Here's my rewritten version!

while true do
	for i = 30,0,-1 do
		wait(60)
		script.Parent.Text = math.floor(i)
	end
end

Good luck scripting!

1 comment

0

I already got it to work perfectly while this, but thank you!

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