while loop Lua code example
Example 1: continue in lua
arr = {1, 2, 3, 5, 6, 7, 8}
for key, val in ipairs(arr) do
if val > 6 then
goto skip_to_next
end
::skip_to_next::
end
Example 2: lua while loops
while true do
print("Looped Text")
wait(1)
end
Example 3: while true do lua
while (statement) do
end
Example 4: while loop bash
while true;
do
#code
done
Example 5: while in lua
while(condition)
do
statement(s)
end
Example 6: forever loop in lua
while( true )
do
print("This loop will run forever.")
end