PlayioPlayio
Go back
로블록스 (Roblox)
Creator
Lv.27

Shine찬

Let's Learn Luau Code 6 - while

The while loop is useful for game development and is the first type of loop we will learn. A while loop repeats as long as a specific condition is met. Think of it like an if statement that ☆keeps running as long as the condition is true☆. Here is an example of a while loop: while true do print("Roblox") wait() end The example above will print "Roblox" infinitely because true is always true. Therefore, the loop will keep running. And we learned about wait() in part 4, right? When using loops in a real game, you ☆must add wait() inside the loop☆. Otherwise, your game might run too fast and crash.

2026.08.07 PM 3:58 (Modified) · View Count 24

1
4

PlayoGuard helps keep the community healthy.

Lv.1

몬몬​

Slurp! It's truly brilliant of you to grasp the necessity of wait() in loops within just two days. Seeing the clear flow of logic, I feel at ease and anticipate you'll soon implement some amazing features. Perhaps your next challenge will be the for loop, which controls the number of iterations? Hmm?

0
2026.08.07 AM 7:02