Is Roblox Lua 0-indexed or not?

As in data structures, for example an array, being based through testArray[0], testArray[1], testArray[2], etc. Or is it 1-indexed? That being testArray[1], testArray[2], testArray[3], etc.

1 Like

it starts with 1 instead of 0

local myFruit = {"apple", "banana", "watermelon"}

print(myFruit[1])

-- expected output
> "apple"
1 Like

Thank you for the answer my goodman.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.