@prvdmwrong/lifecycles
v0.2.0-rewrite.1
Published
An assortment of useful provider lifecycles for Prvd 'M Wrong.
Downloads
15
Readme
More lifecycles for Prvd 'M Wrong
Extends Prvd 'M Wrong with common lifecycle events for player tracking and the runtime.
Includes the following lifecycles:
onPostSimulation(self: Provider<unknown>, deltaTime: number)
fires everyRunService.PostSimulation
onPreSimulation(self: Provider<unknown>, deltaTime: number)
fires everyRunService.PreSimulation
onPreAnimation(self: Provider<unknown>, deltaTime: number)
fires everyRunService.PreAnimation
onPreRender(self: Provider<unknown>, deltaTime: number)
fires everyRunService.PreRender
ifRunService:IsClient
onPlayerAdded(self: Provider<unknown>, newPlayer: Player)
fires when a new player joins the game including all existing players whenroot:onStart
is calledonPlayerRemoving(self: Provider<unknown>, leavingPlayer: Player)
fires when a player leaves the game
This package is intended to be used through root:useProvider
:
local prvd = require(ReplicatedStorage.Packages.prvd)
local prvdLifecycles = require(ReplicatedStorage.Packages.prvdLifecycles)
local root = prvd.root()
-- @prvdmwrong/lifecycles returns a provider which can be used:
:useProvider(prvdLifecycles)
-- use your games providers...
:useModules(ServerScriptStorage.Server.Providers:GetDescendants())
:useModules(ReplicatedStorage.Shared.Providers:GetDescendants())
-- start the root!
:start()
Learn more in the documentation. This package is part of Prvd 'M Wrong