Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Array item coming back as nil?

Asked by 6 years ago
Edited 6 years ago

So basically I want to store a few RGB values into an array as I did below, but when I try to access them it comes back as nil.. What is a better way to do this?

local rgbs = {
    Red = "238, 82, 83",
    Blue = "84, 160, 255",
    Green = "29, 209, 161",
};

print(rgbs[1]) -- Returns nil
2
`print(rgbs.Red)`? TheeDeathCaster 2368 — 6y
0
Thanks... I totally forgot about that! Lol I don't use arrays much YouSNICKER 131 — 6y
0
Np. :P TheeDeathCaster 2368 — 6y

Answer this question