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

Is there a way for me to make a (while true do) not to keep looping?

Asked by 6 years ago

Is there a way for me to make that Player.PlayerGui.Popup.Popup:Remove() not loop it's self over and over?

while true do
    for i = 0,1,0.01 do
        TextLabel.TextColor3 = Color3.fromHSV(i,1,1)
        wait(0.1)
    end
wait(5)
Player.PlayerGui.Popup:Remove()
end

I'd appreciate any advice!

0
Well your not really telling the script to stop at a certain point so it will keep doing it KenUSM 53 — 6y

1 answer

Log in to vote
0
Answered by
lukeb50 631 Moderation Voter
6 years ago

If you want to stop a while true do loop, simply use break

If you want a line to execute only once, use a variable that is set to false before the loop and set to true right before end. You can check if its false to see if the loop is on its first run.

Ad

Answer this question