Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

What Does In Pairs mean?

Asked by
nanaluk01 247 Moderation Voter
8 years ago

Hello! I have seen a few scripters use something called "In Pairs" in their script, and I was wondering what it means and does. It would have been great if someone can answer the question! :)

2 answers

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

A generic for loop calls an iterative function until it halts. pairs is an iterative function that goes through the indices of a table, returning the key, value pairs. ipairs returns the index, value pairs for consecutive positive integer indices only.

Ad
Log in to vote
0
Answered by 8 years ago

well

tab = ["Lol","Lol2","Lol3"]
for i,v in pairs(tab) do
print(v)
end

it just tells a for statement to cycle thru a table .-.

Answer this question