Log in to vote

How would I get the other values of a multidimensional array?

Asked by 15 days ago

I am trying to get the Level Name and Level Status but I haven't found out how to get those with just the level id (ex. "Level1" or index [1] of the 2nd array). Does anybody know how to do this?

local Levels = {
    {"Level0","Level 0","Safe"},
    {"Level1","Level 1","Unsafe"},

1 answer

Log in to vote
Answered by
Ziffixture 6863 Moderation Voter Community Moderator
15 days ago

Multi-dimensional arrays are just arrays of arrays.

Indexing the 2nd element will provide you with an array, which you may index as well:

print(Levels[2][1]) --> "Level1"

Answer this question