Loops help you run code multiple times without repeating it constantly. This way, you can easily accomplish tasks like displaying numbers or iterating through lists.
Here's how:
With loops, you can write your code shorter and more efficiently!
-- Dieses Script kommt in ServerScriptService
for i = 1, 5 do
print("Das ist Durchlauf Nummer: " & i) -- Counts from 1 to 5
end
local count = 1
while count <= 5 do
print("while-Schleife Nummer: " & count) -- Repeats until 5
count = count + 1
end