Need a bit of help with some Roblox Tables (Using multi-dimensional arrays)

I’m trying to make a game and I need to store some data. I’ve got this so far in a module script:

local module = {}

module.Data = {
	
	["Stone"] = {
		["Hardness"] = 10,
		["TimeMult"] = 1,
	},

	["Coal"] = {
		["Hardness"] = 25,
		["TimeMult"] = 1,
	},
	
}

return module

Here’s my error:

I’m very new to scripting, so please excuse me if there’s some blatant error with how I’m trying to call it here:

local Objects = game.Workspace.Objects
local OreData = require(game.ReplicatedStorage.OreData)

for i, ore in pairs(Objects:GetDescendants()) do
	
	if ore.Name == "Hitbox" then
		
		local clickdetector = Instance.new("ClickDetector")
		clickdetector.Parent = ore
		
		local billboard = script.Storage["Billboard"]:Clone()
		billboard.Parent = ore
		
		ore.Transparency = 1
		ore.CanCollide = false
		
		billboard.Frame:FindFirstChild("Name").Text = ore.Parent.Name
		billboard.Frame:FindFirstChild("Progress").Text = tostring(OreData[ore.Parent.Name]["Hardness"]) .. "/" .. tostring(OreData[ore.Parent.Name]["Hardness"]) -- this is the line I call the modulescript in.
		
		
		
	end
end

I couldn’t find any good resources online since I’m not sure what terms to look up so I figured I might as well ask here. Thanks for helping me out :slight_smile:

Edit: Added some more info

You module has a table called Data, you need to reference that before referencing the other tables.

billboard.Frame:FindFirstChild("Progress").Text = tostring(OreData.Data[ore.Parent.Name]["Hardness"]) .. "/" .. tostring(OreData.Data[ore.Parent.Name]["Hardness"]) -- this is the line I call the modulescript in.
1 Like

Thank you so much for the help!

I’ll make sure I do this in future too :slight_smile: