Looping And Breaking

Here you will learn all about loops

by Voice_lessDev

Author Avatar

The Basics

Alright have you seen a script thats just so long due to a single function thats done repeating the same thing?

Then loops the savior of space and time!

Get a simple While Do Loop going!

while true do

end

Fixing Crashes

Congrats! You just made a crashing mess! Of course im kidding its very easy to fix. Allow the script to wait 1

nano second.

while true do

wait()

end

Breaking The Plane

Sorry if you dont get the bad joke.

So how do we stop the loop?

The bad joke has the thing you need to do. [BREAK]ING THE LOOP

while true do
break
end

A Un-Breakable Plane

More bad jokes and your not stoping me!

However go back to the reapting the same thing over and over example we need a new loop! A for do loop!

Bad name but useful!

The concept is hard so im going to make it easy

___ i = 0, 10 __

end

for i = 0, 10 do

end

Timers!

Lets say your building a timer. Its pretty simple to make you just need to add one more , and a negative number

Lets say 1 so how would you do it?

for i = 0, 10, -1 do

end

The End

You have done it! Sorry if im bad at spelling. Im not from the USA, UK or some other country that speaks

english. Mess around try to break stuff! Make a useful discovery! And THE END

View in-game to comment, award, and more!