---
title: "Loops"
url: /docs/en-us/tutorials/fundamentals/coding-4/landing
last_updated: 2026-06-23T22:00:28Z
description: "Learn how to use loops like while and for loops in this tutorial series for Roblox Studio. Great for beginners learning Luau or computer science."
---

# Loops

### Series description

In computer science, loops are a common feature in many scripts, often used to repeat sets of code. This series will cover two of the most common loops: for and while loops.

### Objectives and prerequisites

| **Learning objectives** | Understand situations where loops are useful as opposed to alternative forms of writing a script. Be able to write out for and while loops, while identifying the syntax for both. |
| --- | --- |
| **Prerequisites** | Have a general understanding of variables in Luau. |

### Series Contents

| Article | Description |
| --- | --- |
| [Repeat code with while Loops](/docs/en-us/tutorials/fundamentals/coding-4/repeat-code-with-while-loops.md) | Learn how to repeat code to create a color changing part. |
| [Intro to for loops](/docs/en-us/tutorials/fundamentals/coding-4/intro-to-for-loops.md) | Use a common loop that repeats instructions for a set amount of times. |
| [Loops practice: glowing lights with for loops](/docs/en-us/tutorials/fundamentals/coding-4/glow-lights-with-for-loops.md) | Practice using for loops by making lights glow. |
| [Loops Practice: Creating a Timed Bridge](/docs/en-us/tutorials/fundamentals/coding-4/create-a-timed-bridge.md) | A more advanced implementation of a for loop that makes a bridge disappear and reappear. |
| [Nesting loops](/docs/en-us/tutorials/fundamentals/coding-4/nested-loops.md) | Add a loop within a loop for more complex behavior and code. |