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

What Does In Pairs mean?

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

✓ Accepted answer

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.

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 .-.

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