repeat and until

The purpose of 'repeat' is to start a loop. To use it, all you have to do is write 'repeat' in a script and press enter on your keyboard. After you've done that you should see a bit of space from the beginning of the line. Don't remove that, otherwise the script won't work. Ignore the blank space and write your script, don't forget to add wait() or task.wait() to your script or it won't work. Now you have to find an end to the loop. 

The ending that will be used is called 'until'. All you will need to do is write 'until' and a random number after it. Now you can start planning a script with repeat and until, here is an example:

repeat

      wait(1)

      script.Parent.BrickColor = BrickColor:Random()

until 20

This script can be written and inserted into a part to change its colour to a random one 20 times.