local maps = {
River = {
id = 1;
name = 'Water';
image = 'rbxassetid://11902152566';
};
Industrial = {
id = 2;
name = 'Meat';
image = 'rbxassetid://11902230108';
};
}
To call the dictionary, I want to use the ‘id’ value inside the dictionary to identify it: module:getMapData(id). How do I make the module return the proper values?
Iterate over the dictionary and compare the id properties:
for name, data in maps do
if data.id == ID then
-- Compare the current id to the provided id in the function
-- returns the index and the map data
return name, data
end
end