Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What kind of loop is this and used mainly for?

So in some scripting videos i see people using this time of loops or something else maybe called i don't really know and searched many places for answers it looks like for loops but don't get what this is because it only have two values.

for i = 1,10 do -- Don't get it what kind of loop is this with 2 values only?
print("h")	
end

Edited by JesseSong:

##Numerical For loop

It's a numerical for loop you can find more info at the developer hub!

####They're mainly used for count downs, like timers, intermission - gui and etc.

1 comment

0

Please do some research before asking, otherwise your question will be closed!

1 answer

Firstly, please work on how you function your questions. Secondly, this is a for loop, it usually goes through each and every child or number that the script has told it to, for example:

local gameC = game:GetChildren()

for _,v in ipairs do
print(v) -- will print the selected object
end

This discussion is preserved as it was. New answers, comments, and votes are closed.