lua for loop
-- For K,V in table
for k,v in pairs(tbl) do
print(k)
print(v)
end
-- For i=0, num
for i=0, num do
print(i)
end
lua for loop
-- For K,V in table
for k,v in pairs(tbl) do
print(k)
print(v)
end
-- For i=0, num
for i=0, num do
print(i)
end
lua how to make a loop
for init,max/min value, increment
do
statement(s)
end
For loop lua
for startValue, EndValue, [increments] do
--code to execute
end
--The increments value is optional. If it isn't defined, it is assumed to be "1"
lua how to make a loop
-- for in/for loops
for key, value in pairs(table) do
-- If value is a table then you can do another iteration tho, for in for in isn't recommended.
end
for key, value in next, table do
-- Same as above.
end
for variable = 0, 1, 1 do
-- The variable is automatically set to the first value you input after "=".
-- The variable is then incremented by the third value you input after "="
-- until it reaches the second value you input after "=".
variable = variable + 1 -- The above only works if you increment it,
-- else it infinitely loops through the block.
end
while true do
-- Infinite loop
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us