local Y local F local W=game:GetService("\080\108\097\121\101\114\115")local m=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local A=game:GetService("\082\117\110\083\101\114\118\105\099\101")local l={}local e={}l.Loaded=false local B local b=(m:WaitForChild("\080\097\099\107\097\103\101")).Modules if not A:IsClient()then Y=game:GetService("\083\101\114\118\101\114\083\116\111\114\097\103\101")F=game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")B=(Y:WaitForChild("\080\097\099\107\097\103\101")).Modules end function l.Init(Y)for Y,F in pairs(script:GetChildren())do if F:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then for Y,F in pairs(require(F))do l[Y]=F end end end for Y,F in pairs(b:GetChildren())do if F:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then e[F.Name]=require(F)end end if B~=nil then for Y,F in pairs(B:GetChildren())do if F:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then e[F.Name]=require(F)end end end for Y,F in pairs(e)do if F.Init~=nil then F:Init()end end wait()l.Loaded=true end function l.Get(F,Y)if e[Y]~=nil then return e[Y]end end function l.newModule()local Y={}setmetatable(Y,{__index=l})function Y.Init(Y) end return Y end return l
--[[
8888ba.88ba   .d888888  888888ba   .88888.   .88888.  dP    dP .d88888b      88888888b  888888ba   .d888888  8888ba.88ba   88888888b dP   dP   dP  .88888.   888888ba  dP     dP 
88  `8b  `8b d8'    88  88    `8b d8'   `8b d8'   `8b Y8.  .8P 88.    "'     88         88    `8b d8'    88  88  `8b  `8b  88        88   88   88 d8'   `8b  88    `8b 88   .d8' 
88   88   88 88aaaaa88a 88     88 88     88 88     88  Y8aa8P  `Y88888b.    a88aaaa    a88aaaa8P' 88aaaaa88a 88   88   88 a88aaaa    88  .8P  .8P 88     88 a88aaaa8P' 88aaa8P'  
88   88   88 88     88  88     88 88     88 88     88 d8'  `8b       `8b     88         88   `8b. 88     88  88   88   88  88        88  d8'  d8' 88     88  88   `8b. 88   `8b. 
88   88   88 88     88  88    .8P Y8.   .8P Y8.   .8P 88    88 d8'   .8P     88         88     88 88     88  88   88   88  88        88.d8P8.d8P  Y8.   .8P  88     88 88     88 
dP   dP   dP 88     88  8888888P   `8888P'   `8888P'  dP    dP  Y88888P      dP         dP     dP 88     88  dP   dP   dP  88888888P 8888' Y88'    `8888P'   dP     dP dP     dP 
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
The good one
]]

local ServerStorage
local ServerScriptService
local Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local FWork = {}
local Modules = {}

FWork.Loaded = false

local SModulesFolder
local ModulesFolder = Replicated:WaitForChild("Package").Modules
if not RunService:IsClient() then
	ServerStorage = game:GetService("ServerStorage")
	ServerScriptService = game:GetService("ServerScriptService")
	SModulesFolder = ServerStorage:WaitForChild("Package").Modules
end

function FWork:Init() --initializes the module
	for _, module in pairs(script:GetChildren()) do
		if module:IsA("ModuleScript") then
			for i, v in pairs(require(module)) do
				FWork[i] = v
			end
		end
	end
	for _, module in pairs(ModulesFolder:GetChildren()) do
		if module:IsA("ModuleScript") then
			Modules[module.Name] = require(module)
		end
	end
	if SModulesFolder ~= nil then
		for _, module in pairs(SModulesFolder:GetChildren()) do
			if module:IsA("ModuleScript") then
				Modules[module.Name] = require(module)
			end
		end
	end
	for i, v in pairs(Modules) do
		if v.Init ~= nil then
			v:Init()
		end
	end
	wait()
	FWork.Loaded = true
end

function FWork:Get(Name) --used for getting cached modules
	if Modules[Name] ~= nil then
		return Modules[Name]
	end
end

function FWork.newModule() --used for module creation
	local Module = {}

	setmetatable(Module, {
		__index = FWork,
	})

	function Module:Init() end

	return Module
end

return FWork
