How would I get table values from inside of a table?

Okay so sort of confusing but here’s my situation.

local Table = {
	["First"] = "1",
	["Second"] = Table.First
}

– [“Second”] always comes out as nil.

I don’t need to do this, however it’d shorten my code a lot. If there isn’t a possible way to do this it’ll just mean ugly code on my end. No worries. Any help is appreciated.

Correct me if I’m wrong. But I don’t think you can reference the table when you’re still defining its values. You can reference the table outside of the {}. Not 100% sure on this.

3 Likes

Table[1]
You have to get it from where its placed at.

Doesn’t work, odds are I can’t do what I’m trying to do. RIP.

Can you show the other table?
(please)

Heres example of my table

local ColorTable = {
	[0] = Color3.new(0, 0, 1),
	[1] = Color3.new(0, 0, 1),
	[2] = Color3.new(1, 0, 0),
	[3] = Color3.new(0, 1, 0),
	[4] = Color3.new(1, 1, 0)
}

you could just change words to numbers

local Table = {
	[1] = "1"
	[2] = Table[1]
}

But I haven’t tried referencing table in table so im not shure it would work

No. If you do carrot brackets like these [] you are getting the first thing inside of it.

For instance:
args = string.split(msg, " ")
local getChar1 = args[1]
local getChar2 = args[2]