@prvdmwrong/core
v0.2.0-rewrite.2
Published
Core Prvd 'M Wrong functionality including components and networking.
Downloads
28
Readme
Prvd 'M Wrong
Core Prvd 'M Wrong functionality including providers, lifecycles, and module roots along with built-in components and networking.
local PlayerProvider = {}
type Self = typeof(PlayerProvider)
function PlayerProvider.onInit(self: Self)
self.playerAdded = prvd.lifecycle("onPlayerAdded", prvd.fireConcurrent)
local function onPlayerAdded(newPlayer: Player)
self.playerAdded:fire(newPlayer)
end
self.conn = Players.PlayerAdded:Connect(onPlayerAdded)
for _, existingPlayer in Players:GetPlayers() do
onPlayerAdded(newPlayer)
end
end
function PlayerProvider.onStop(self: Self)
self.playerAdded:destroy()
self.conn:Disconnect()
end
return prvd(PlayerProvider)
Learn more in the documentation. This package is part of Prvd 'M Wrong