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

What's wrong with my TimeTable Countdown Script?

I am making a TimeTable where it Countsdown from the NumberValue to 0, but I want it to re-count it down back to 0 again, instead of -1, -2, e.t.c. I even made another NumberValue to restore it back to it's original number, but it doesn't work. Also, this is on a SurfaceGUI.

while true do
	script.Parent.Text = script.Parent.TValue.Value
	wait(1)
	script.Parent.TValue.Value = script.Parent.TValue.Value - 1
	
	if script.Parent.TValue == 0 then
		script.Parent.TValue = script.Parent.OValue - 1
		
		end
	end

1 answer

✓ Accepted answer

The mistake you made was that on line 6 and 7 you forgot to put a .Value after each of the numbers

The correct code would be :

while true do
	script.Parent.Text = script.Parent.TValue.Value
	wait(1)
	script.Parent.TValue.Value = script.Parent.TValue.Value - 1

	if script.Parent.TValue.Value == 0 then -- Added .Value
		script.Parent.TValue.Value = script.Parent.OValue.Value - 1 -- Added .Value
	end
end

If you have any questions, concerns or just need some help with this PM me on ROBLOX!

1 comment

0

Oops, thank's

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