Modding
You can "mod" Quebec by creating custom lifecycle events. It is recommended to create a lifecycles folder in either a shared, client or server folder for easy access.
Creating A Custom Lifecycle
We provide a Quebec.lifecycle function to easily create a lifecycle:
local Quebec = require(PATH_TO_QUEBEC)
local Lifecycle = Quebec.lifecycle({
defaultMethod = "onPlayerAdded"
})
type Lifecycle = Quebec.CustomLifecycle<typeof(Lifecycle)> -- not mandatory, but useful
function Lifecycle.run(self: Lifecycle)
-- this code will run after all singletons have loaded which attach to your lifecycle
for _, player in Players:GetPlayers() do
-- this invokes the lifecycle on all singletons which use it
self:invokeAll(player)
end
Players.PlayerAdded:Connect(function(player)
-- the same as "invokeAll", but it runs the methods in the same thread
self:invokeAllSameThread(player)
end)
end
return LifecycleUsing Custom Lifecycles
It's basically the same as registering normal lifecycle events, but instead of the lifecycle name, you require it:
Of course, you can also remap the lifecycle:
Last updated