Posted 04 December 2012 - 11:45 AM
Before you ask, YES I know how to put variables into a table. What I am asking is how to I put variables into an index OF a table? For example:
I have a feeling that I have to do something like this:
local digits = {
[1] = {
".---.",
"| 1 |",
"'---'"}
}
Where I would like to be able to ONLY make that ONE index. And be able to replace the index number "1" and the string number "1" so I only have to call to it once. Is there a way to do that?I have a feeling that I have to do something like this:
local function digits(n)
local button = {
[n] = {
".---.",
"| "..n.." |",
"'---'"}
}
return button[n]
end