Is my Data Module any good?


I made the this thing hoping to store data within a ModuleScript, any potential improvements?

local Loader = require(script.Parent.Parent.ModuleLoader)

local DataFunctions = Loader:Load("DataFunctions")

local Data = Loader:Load("DefaultData")

local Default = Data.DefaultData

local Module = {}

local Metatable = {}

local Prototype = Default

Metatable.__index = Prototype;

    Module[Player.Name] = {}

    local NewIndex = Module[Player.Name]

    local self = setmetatable({}, NewIndex)
    return self

function Metatable.Initialize(self, Player)

    local Key = "id_" .. Player.userId

    if not Data.DataStore:GetAsync(Key) then

        Save(Key, Default)

        self = Default


        local Data = Load(Key)

        self = Data


    return self


Module.Metatable = Metatable;

return Module;


I think your code would be better if you indented your code inside your functions


This is important. I can’t read your code at all because it’s not indented.


It was indented, when i pasted it broke.

Also, I just fixed.