local module = {}
module.__index = module
local startmain = require(script.SpawnMain)
local Hatsmain = require(script.GetHats)
local SpawnMain = require(script.SpawnHat)
local Datas = require(script.DataStore)
local devpro = require(script.DevProducts)
game.Players.PlayerAdded:Connect(function(plr)
print("added")
Datas:Load(plr)
end)
module.Hat = Hatsmain.GetHats()
function module.Start()
devpro:Start()
startmain.Start(setmetatable({},module))
end
function module.SpawnHat(id,price)
SpawnMain.SpawnHat(id,price)
end
function module:AttemptSpawnHat()
SpawnMain.AttemptSpawn(self.Hat)
end
return module
so at this code i want to make module.hat variable a global variable also i do not want to call the GetHats() function everytime i require the module i want the module to load the hat var and do not load it again