loops roblox code example

Example 1: loop true childs roblox

for i,v in pairs(game.Players:GetChildren()) do
-- v is your player
end

Example 2: loop roblox studio

while wait() do
	print("Looping...") -- This Will Loop
  	wait() -- Make Sure The Script Doesnt Crash
end)
-- Another Method 
while true do
	print("Looping...") -- This Will Loop
	wait() -- Make Sure The Script Doesnt Crash
end)

Example 3: for loop roblox

for i,v in pairs() do

end

-- or

for i,v in next,  do

end

Example 4: roblox repeat until

repeat
	spawnGoblin()
	currentGoblinCount = currentGoblinCount + 1
	print("Current goblin count: " .. currentGoblinCount)
until currentGoblinCount == 25

Tags:

Misc Example