Tables: Lua's Only Data Structure
Lua has exactly one built-in data structure, the table, and it does the job of arrays, dictionaries/maps, and even objects in other languages.
Tables as arrays
ipairs iterates a table in order from index 1 until the first nil, exactly what you want for array-like tables.
Tables as maps/objects
pairs iterates every key in a table, in an unspecified order, use it for map-style tables where order doesn't matter. player.name and player["name"] always refer to the exact same table entry, dot syntax is purely a convenience for string keys that are valid identifiers.
TIP
Because arrays, maps, and objects are all "just a table" in Lua, a single table can even mix both styles: numeric indices for a list part and named keys for extra fields on the same object.