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

Why doesn't my repeat stop after it reaches it's goal?

Issue

The issue is quite simple, the repeat doesn't stop when it reaches my desired goal. The Volume Default Value is 1. It starts at 0 and slowly rises.

The Error part of the script

		repeat 
			Audio.Volume = Audio.Volume + 0.1
			wait(0.5)
		until Audio.Volume == Volume

2 answers

✓ Accepted answer

Have you tried '>='? The issue could be that it's going over your Volume value and therefore it's never going to be equal to Volume. Using '>=' (Over or equal) will detect if it is either over, or equal to Volume. If it is, then it will stop the Loop.

repeat 
    Audio.Volume = Audio.Volume + 0.1
    wait(0.5)
until Audio.Volume >= Volume

1 comment

0

Nice explanation

I think you should change == to >= for it to work

repeat
	    Audio.Volume = Audio.Volume + 0.1
	    wait(0.5)
	until Audio.Volume >= Volume

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