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

How to make a loop work when a value changes and then it comes back to its original value?

repeat wait() until v.Value == 1

I'm trying to make this repeat every time the value gets to 1.

What's actually happening : It works for the first time then the value changes to 2. When it's 1 again, the script doesn't do anything.

Any suggestions or solutions for this?

1 answer

✓ Accepted answer

Your script works once since there is no loop to make it work every time. Try this

while true do
	wait(.1)
	if v.value ~= 1 then
		repeat wait() until v.value == 1
	end
end

Hope it helps

1 comment

0

Thank you!

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