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

How do I break a loop?

Asked by 10 years ago

I really just need to know this ASAP. Here's the script:

wait(0.1)
while true do
    script.Parent.Text = "SAVING"
    wait(0.5)
    script.Parent.Text = "SAVING."
    wait(0.5)
    script.Parent.Text = "SAVING.."
    wait(0.5)
    script.Parent.Text = "SAVING..."
    wait(0.5)
    break(10) -- ERROR: Expected 'end' (to close 'do' at line 2), got '('
end
0
What are you intending to do with line 11? Break is a keyword, not a function that you call. adark 5487 — 10y
0
Then how do I change it into a keyword? SchonATL 15 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

I think this is what you we're intending...

wait(0.1)
while true do
    script.Parent.Text = "SAVING"
    wait(0.5)
    script.Parent.Text = "SAVING."
    wait(0.5)
    script.Parent.Text = "SAVING.."
    wait(0.5)
    script.Parent.Text = "SAVING..."
    wait(0.5)
wait(10)
    break
end

or

wait(0.1)
while wait(10) do
    script.Parent.Text = "SAVING"
    wait(0.5)
    script.Parent.Text = "SAVING."
    wait(0.5)
    script.Parent.Text = "SAVING.."
    wait(0.5)
    script.Parent.Text = "SAVING..."
    wait(0.5)
    break
end

I don't really know what you're doing.

0
I figured out a better way to fix my problem. It's a bit complicated. But thank you anyways :) SchonATL 15 — 10y
0
K, you really didn't give us that much information though. EzraNehemiah_TF2 3552 — 10y
Ad

Answer this question