EasyAdmin
Basic Understanding
EasyAdmin was designed to be, well, easy. No bloat and works out of the box. You can access EasyAdmin from any script by calling on the module inside ReplicatedStorage.
local EasyAdmin = require(game:GetService("ReplicatedStorage):WaitForChild("EasyAdmin))
Startup Order
EasyAdmin will startup in the following order
Loader calls the admin's MainModule
MainModule sends custom Settings from the Loader to EasyAdmin
EasyAdmin is parented to ReplicatedStorage
(Server) Loads Shared modules, Server modules, and Server Packages
(Server) Initiates client setup
(Clients) load all Shared modules, Client modules, Client Packages
Shared Modules
Shared Modules are shared with both Client and Server (who would've thought?). These modules are standalone and do not require any Context from EasyAdmin to run. They are basic modules, that serve as helpers to the main admin's functions. These modules are loaded directly into EasyAdmin's environment and can be called on directly. For example, a Shared Module named PlayerUtils
can be indexed by simply doing EasyAdmin.PlayerUtils.
Server/Client Modules
These modules load after the shared modules. It is required that they return a function, so the EasyAdmin Context may be passed down through an argument to the contents of the module. From inside the module, you can define and functions or methods you would like. When these modules are loaded, they are inserted directly into the Admin's enviroment, just like Shared Modules. For example, a Module names Ranks
can be indexed by simple doing EasyAdmin.Ranks
Server/Client Packages
Packages function the same as the Server/Client Modules. They are created by third-parties and are not a part of the default admin system itself. Any code inside Packages can interact with Shared Modules and Server/Client Modules immediately. If you need a Package to interact with another Package, wait until all Packages have loaded, and utilize the Start
function of a Package, which runs after all packages have been initiated. Packages are not stored directly in the Admin's Context. They can be acessed by doing EasyAdmin.Packages.<PackageName>
return function(Context) --Context *is* EasyAdmin
local Package = {}
print("This code will run immedietly")
Package.Start = function()
print("This code will run after all Packages are done loading")
end
return Package
end
Last updated