Forever Loop в Луа
while( true )
do
print("This loop will run forever.")
end
Catking The Cat That Has An Extremely Long Username
while( true )
do
print("This loop will run forever.")
end
-- Lua has no continue statement because it's designed to
-- be lightweight. Use goto instead:
arr = {1, 2, 3, 5, 6, 7, 8}
for key, val in ipairs(arr) do
if val > 6 then
goto skip_to_next
end
-- perform some calculation
::skip_to_next::
end
while i < n do
print(i^2) -- Same here
i = i+1 --Stick your own here
end
local can_do = true
local countdown = 0.85 --you can choose whatever you want
while can_do do
--here your code
wait(countdown)
Open while loops can potentially crash your program so be careful!