while true do lua code example

Example 1: lua while loops

--// Basic while true do loop

while true do
	
	--// Looped text
	print("Looped Text")
	
	--// Time the loop waits before looping again
	wait(1)
end

Example 2: while true do lua

while (statement) do
	-- code
end

Example 3: loop true childs roblox

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

Example 4: while in lua

while(condition)
do
   statement(s)
end

Example 5: roblox repeat until

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