Simple Module Dictionary Help

So I have a module dictionary like this…

local Codes = {
	["Valid"] = 
		{
			["NoSimpSeptember"] = {"Cash", 100}; 
			["BamBoomBam"] = {"Item", game.ServerStorage.TeddyBloxpin--[[Gear path like, game.ServerStorage.PersonalSpaceCraft]]};
		},	
	
	["Expired"] = 
		{
			"MorningTea";
		},
}
return Codes

I want to get all the values from it like this,

local code = "NoSimpSeptember"
for ValidCode, _  in pairs(Code_Library.Valid) do
	if ValidCode == code then
		local Code_Reward = ValidCode[2]
	      local Code_Attribute = ValidCode[1]
       end
end

the problem is it doesn’t give me a valid string, instead it shows me nil

1 Like

Instead of _ you should make “CodeInfo” or whatever you would like to name it and just do CodeInfo[2] because ValidCode is index not the table with informations.

2 Likes