While True Do

This loop is the most used and I think is one of the most useful.  It loops around a script until it is broken.  This requires an if then statement.  To start you need to type while the following statement is true then do (then you have to put the statement in this case it will be to count to ten)  count to ten when you get to ten then stop looping and end the script.


local n = 0
while true do
n = n + 1
wait(1)  --If you don't do this then it will crash your game
print (n)
if n == 10 then  -- the == is actually equal to = is is 
break
end
end