Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's wrong with my TimeTable Countdown Script?

Asked by 10 years ago

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

Log in to vote
1
Answered by
samfun123 235 Moderation Voter
10 years ago

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!

0
Oops, thank's ScriptingHelpersALT 20 — 10y
Ad

Answer this question