how to run a loop in another loop while roblox code example
Example 1: roblox repeat until
repeat
spawnGoblin()
currentGoblinCount = currentGoblinCount + 1
print("Current goblin count: " .. currentGoblinCount)
until currentGoblinCount == 25
Example 2: roblox for loop
local Table = {"Hello", 1234, "Whatever"}
for i, Entry in pairs(Table) do
print(i)
print(Entry)
end
--> 1
--> Hello
--> 2
--> 1234
--> 3
--> Whatever