Help with module

For some reason, when I’m printing the PotentialMaps, it’s printing an empty table.

Script:

local mapList = require(game.ServerScriptService.Framework.Utilities.MapList)

local function selectMaps()
	local potentialMaps = {}
	local selectedMaps = {}
	local chosenMap
	
	
	for _, mapInList in ipairs(mapList.Maps) do
		if mapInList.CurrentlyEnabled then 
			table.insert(potentialMaps,mapInList)
		end
	end
	
	print(potentialMaps)
end

Module:

return {
	["Maps"] = {
		["Classic"] = {
			["Name"] = "Classic",
			["DisplayName"] = "Classic",
			["DisplayImage"] = "rbxassetid://",
			["CurrentlyEnabled"] = true
		}
	}
}

Appreciate help, no errors.

Use pairs instead of ipairs since you have a dictionary

1 Like

Oops, apologies I totally forgot about that. It’s working now.

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!

1 Like