I've noticed there was something called "repeat" and "wait() while do" I know they both loop, but what's the difference between these two terms?
repeat
and while
loops are both do the same thing, and that is loop. However they both have different ways of handling arguments.
while
loops continue on as long as their condition is met.
That is why you may see scripts have the following;
while wait() do end while true do end
Since wait() always exists, then that condition is met and is true. Therefore the script will loop until that statement is false. Which of course they will never be.
These are somewhat of an opposite as they loop until their condition is met.
Hence why you might see
repeat until nil repeat wait() until script.Parent.BrickColor == BrickColor.new('Bright blue')
The script will loop anything between repeat and until until the condition is met. Nil means false so the loop will continue to run. For the second script, the loop will run until the script parent's BrickColor is Bright Blue (or they are under an object that does not have a BrickColor property).