A question about tables

So let’s say I have this table

local Table = {
	Texture1 = {
		Color = Color3.fromRGB(255,255,255),
		OffsetStudsU = 0,
		OffSetStudsV = 0,
		StudsPerTileU = 2,
		StudsPerTileV = 2,
		Texture = "String",
		Transparency = 0
	},
	
	Texture2 = {
		Color = Color3.fromRGB(0,0,0),
		OffsetStudsU = 99,
		OffSetStudsV = 80,
		StudsPerTileU = 10,
		StudsPerTileV = 5,
		Texture = "Blah",
		Transparency = -1
	}
}

How do I call / print something inside the Texture1 table or the Texture2 table if they are within another table

You can access it similar to how you’d access nested objects in the workspace:

print(Table.Texture1.Color)

You can also write it like this:

print(Table["Texture1"]["Color"])
1 Like

Wait so you can use 2+ brackets to call a table? I thought you can only do 1 bracket Table[thing] not 2 Table[thing][thing]

Well everything is inside the table Table

Everything is going to be split into two other tables inside of the table

Texture1 and Texture2

You can do

print(Table.Texture1[valuehere]) for Texture1

or

print(Table.Texture2[valuehere]) for Texture2

1 Like

Yeah you can do it as many times as you’d like!

1 Like

Yeah, What RoyStanford said is correct.

1 Like

If you want to really make sure you understand it, I recommend making a new studio, and mess around with the table values(spam the prints!). This ensures you are getting the desired value in the table.