jecs/demo/src/ServerScriptService/main.server.luau

22 lines
605 B
Text
Raw Normal View History

local ReplicatedStorage = game:GetService("ReplicatedStorage")
2025-04-28 21:40:03 +00:00
local ServerScriptService = game:GetService("ServerScriptService")
local jecs = require(ReplicatedStorage.ecs)
local schedule = require(ReplicatedStorage.schedule)
2024-08-29 13:45:49 +00:00
2025-04-28 21:40:03 +00:00
require(ReplicatedStorage.components)
2025-07-27 12:39:43 +00:00
local world = jecs.world()
2025-04-28 21:40:03 +00:00
local systems = ServerScriptService.systems
2025-10-13 22:41:22 +00:00
local heartbeat = schedule(world,
systems.players_added,
systems.poison_hurts,
systems.health_regen,
systems.lifetimes_expire,
systems.life_is_painful,
systems.entities_delete,
systems.replication
)
game:GetService("RunService").Heartbeat:Connect(heartbeat)