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

How do you break repeat until loops? I really need answers

So i'm making a fading and out my gui so basically i want it to fade in and then break the repeat until loop. Then i want it to fade out and break the loop again how do i do that?

repeat wait(0.1) black.BackgroundTransparency = black.BackgroundTransparency-0.01 until black.BackgroundTransparency >0.10
black.BackgroundTransparency = 0

repeat wait(0.1) black.BackgroundTransparency = black.BackgroundTransparency + 0.01 until black.BackgroundTransparency > 0.99
black.BackgroundTransparency = 1

2 answers

Use break to break a Repeat-Until Loop

Required Knowledge For The Script Below: Loops, Condition Structure, Variables, Math

local count = 0

repeat
	count = count + 1
	print(count)
	if count == 5 then
		print("broke")
		break
	end
	wait(1)
until game == nil

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