Hey there! I’m trying to use a module script to save dictionaries so I can easily access/save them, but for some reason I can’t save any data to it.
It does work if I do this:
-- example
inventoryData.Set(player.UserId, gear, {['upgradeNr'] = value})
But not like this:
-- example
equippedData.Set(player.UserId, itemType, item)
And I get the index nil error.
Modulescript:
local module, data = {}, {}
function module.Set(key, name, values)
data[key][name] = values
end
function module.SetAll(key, values)
data[key] = values
end
function module.Get(key)
return data[key]
end
return module
Any way I can make this work? Any help is appreciated!