2025-06-05 20:48:13 +00:00
|
|
|
local collect = require("../../ReplicatedStorage/collect")
|
|
|
|
local types = require("../../ReplicatedStorage/types")
|
|
|
|
local ct = require("../../ReplicatedStorage/components")
|
|
|
|
local Players = game:GetService("Players")
|
|
|
|
|
|
|
|
local player_added = collect(Players.PlayerAdded)
|
|
|
|
return function(world: types.World, dt: number)
|
|
|
|
for player in player_added do
|
|
|
|
local entity = world:entity()
|
|
|
|
world:set(entity, ct.Player, player)
|
|
|
|
end
|
|
|
|
|
|
|
|
for entity, player in world:query(ct.Player):without(ct.Renderable) do
|
|
|
|
local character = player.Character
|
2025-07-02 16:25:20 +00:00
|
|
|
if not character then
|
|
|
|
continue
|
|
|
|
end
|
2025-06-05 20:48:13 +00:00
|
|
|
if not character.Parent then
|
2025-07-02 16:25:20 +00:00
|
|
|
continue
|
2025-06-05 20:48:13 +00:00
|
|
|
end
|
2025-07-02 16:25:20 +00:00
|
|
|
|
|
|
|
world:set(entity, ct.Renderable, character)
|
2025-06-05 20:48:13 +00:00
|
|
|
end
|
|
|
|
end
|