Why AuraConfig Return Nil, When I try to index it?

I tried everything i could, i can’t find any solution to fix this error… i’m try to index an auraConfig
to change their properties to represent on their rarity

image

As you can see, i’m trying to change the background color with their rarity name but when i tried to test, it’s returning nil… So I tried to printing the key, it printed nil. I can’t find any solution from devforum to youtube.

Server:

local function setupInventory(player, character)
	local AuraOwned = player:WaitForChild("AuraOwned")
	local playerGUI = player:WaitForChild("PlayerGui")
	local MainGUI = playerGUI:WaitForChild("Inventory")
	local MainFrame = MainGUI:WaitForChild("Main")
	local template = MainFrame.Template:WaitForChild("TemplateButton")
	local scrollingFrame = MainFrame:WaitForChild("ScrollingFrame")
	local itemGui = template:Clone()
	
	for i, items in pairs(AuraOwned:GetChildren()) do
		itemGui.Name = items.Name
		itemGui.Text = items.Name
		itemGui.Parent = scrollingFrame
		itemGui.Visible = true
		print(auraConfig[items.Name])
		
		itemGui.MouseButton1Click:Connect(function()
			local getAuraEquip = character:GetAttribute("AuraEquip")
			local itemGuiLabel = itemGui.Text
			character:SetAttribute("AuraEquip", itemGuiLabel)
			aurasModule.AuraEquipped(character, player, getAuraEquip)
			itemGui.Click:Play()
		end)
	end
end

Module:

local module = {
	Dice = Color3.fromRGB(251, 255, 0);
	Death = Color3.fromRGB(72, 0, 255);
	Deceased = Color3.fromRGB(255, 0, 4);
	RadioActive = Color3.fromRGB(0, 17, 255)
}

return module

image

Any Solutions? I will be honored.

print(auraConfig[items.Name])

Is this where the nil is being printed? I’d like to see where auraConfig is defined as a variable. The problem might have to do with that. Or does auraConfig just indicate the module that’s being required?

Yes, i tried to test whats the problem. it printed nil and yeah i can show you

image
forgot this


You’re requiring the wrong module script, I believe. Redefine the path to the AuraConfig module script, and it should work.

OH, i’m blind, sorry about that… thanks for your help!


Thank you, sorry if i was wasting your time there, i can’t see very well… with my scripts. it’s unorganized abit.

No worries! Even the more experienced make silly mistakes like this that take way too long to find out lol.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.