Video summary

Breaks & Continues - Roblox Beginners Scripting Tutorial #12 (2025)

Main summary

Key takeaways

Educational

Summary

This tutorial explains how to control loops in Roblox scripting with break and continue, and how to use comments to document or temporarily disable code.

Loop execution and order

Loops written one after another in the same script run sequentially. If the first loop contains waits, the script waits for that loop to finish before starting the next one. Running loops simultaneously is covered in a later, more advanced lesson.

In a numeric for loop, the increment defaults to 1, so you can omit it when that is the desired increment.

Using break

break ends a loop immediately when the code reaches it. For example, a for loop might count toward 100,000 but check whether its counter has reached a chosen value. When it has, break stops the loop rather than allowing it to continue through all its iterations.

The same approach works in a while loop: check a condition inside the loop, then use break when the loop should end. A while loop does not update its counter automatically, so the script needs to increment it—for example, with counter = counter + 1. Without an appropriate update or stopping condition, a loop may run too long and cause the script to time out.

Using continue

continue skips the rest of the current iteration and moves on to the next one. In the example, the script checks whether the loop counter is 10. If it is, the script prints a message and uses continue, skipping the ordinary print statement for that iteration.

Both break and continue can control for and while loops when particular conditions are met.

Using comments

A single-line comment begins with --. Commented code is not executed, but remains in the script and can be restored by removing the comment marker.

A multiline comment begins with --[[ and ends with ]]. This lets you comment out a block of code without deleting it. Comments can also explain what code does, making scripts easier for others to understand.

The learning exercise is to add break and continue statements to code, describe loops or other code with comments, and comment out unused code.

Speakers and sources

  • Brev, the presenter associated with the BrawlDev channel, explains the concepts and demonstrates them in a Roblox script.
  • Roblox Studio and script output are shown as the environment for running and observing the examples.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video