What is ipairs can someone help

i literally cant find anything that tells me what ipair is please tell me

1 Like

ipairs is a function you can use to iterate through an array. It guarantees order and It’ll stop when it finds a nil value.

Example:

local array = {"hi", "hello", "bye"}
for i, v in ipairs(array) do
    print(i, v)
end

That will print

1 hi
2 hello
3 bye
1 Like

This question is answered here: In pairs() vs in ipairs() Which one should I use?

1 Like