Getting a table value inside a table

I am trying to get a value from a module script within a module script, but it can’t be indexed. Any way around this?

local raceMod = {
	
	
	
	["RarityColors"] = {
		["Common"] = Color3.fromRGB(255, 255, 255),
		["Rare"] = Color3.fromRGB(0, 159, 232),
		["Very rare"] = Color3.fromRGB(187, 0, 193),
		["Legendary"] = Color3.fromRGB(243, 255, 0),
		["Mythic"] = Color3.fromRGB(172, 0, 2)
	},
	
	
	["Races"] = {
		
		["Conqueror"] = {
			["Rarity"] = "Legendary",
			["Color"] = raceMod["RarityColors"]["Legendary"] -- this part (raceMod cant be indexed) 
			
		},
	}

You are attemping to index the entire table. What exactly are you trying to get?

raceMod["Races"]["Conquerer"]["Color"]

Is that what you are indexing?

I am trying to get the color value from the ["RarityColors"]

Why can’t you just index it using

raceMod["RarityColors"]["Legendary"]

There isn’t a need to repeat the value, you could even move

["RarityColors"] = {
		["Common"] = Color3.fromRGB(255, 255, 255),
		["Rare"] = Color3.fromRGB(0, 159, 232),
		["Very rare"] = Color3.fromRGB(187, 0, 193),
		["Legendary"] = Color3.fromRGB(243, 255, 0),
		["Mythic"] = Color3.fromRGB(172, 0, 2)
	},

to be a child of [“Color”].

I dont think you’re understanding.
This part

["Color"] = raceMod["RarityColors"]["Legendary"] -- this part (raceMod cant be indexed) 

cant index raceMod because they are inside the same table

That’s the reason it isn’t working, you can’t index a value from the same table. Do something like this:

local Colors = {

	["RarityColors"] = {
		["Common"] = Color3.fromRGB(255, 255, 255),
		["Rare"] = Color3.fromRGB(0, 159, 232),
		["Very rare"] = Color3.fromRGB(187, 0, 193),
		["Legendary"] = Color3.fromRGB(243, 255, 0),
		["Mythic"] = Color3.fromRGB(172, 0, 2)
	},
}

local raceMod = {
	
	["Races"] = {
		["Conqueror"] = {
			["Rarity"] = "Legendary",
			["Color"] = Colors["RarityColors"]["Legendary"]
		},
	}
}

Place them into two seperate tables, and you should be able to access Colors from inside raceMod.
Then index it using:

print(raceMod["Races"]["Conqueror"]["Color"])