xxxxxxxxxx
-- Looping through strings require gmatch.
for str in targetStr:gmatch("([^%s]+)") do
print(str)
end
-- To learn about patterns please go to www.lua.org
xxxxxxxxxx
-- 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
xxxxxxxxxx
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"
xxxxxxxxxx
for <init>,<max/min value>, <increment> [default is 1]
do
statements
end
-- Example
for i=1, 5, 1
do
print(i)
end
--Output
1
2
3
4
5
xxxxxxxxxx
while true do
-- Put what you want looped in here
-- Do mind that this doesn't work for roblox and for that you should be using the roblox devforum.
end