jecs/demo/src/ReplicatedStorage/start.luau

37 lines
1.1 KiB
Text
Raw Normal View History

local ReplicatedStorage = game:GetService("ReplicatedStorage")
2024-08-29 16:56:50 +00:00
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local jabby = require(ReplicatedStorage.Packages.jabby)
2024-09-06 13:17:59 +00:00
local std = require(ReplicatedStorage.std)
local Scheduler = std.Scheduler
local world = std.world
2024-08-29 16:56:50 +00:00
local function start(modules)
local scheduler = Scheduler.new(world, require(ReplicatedStorage.std.components))
for _, module in modules do
require(module)(scheduler)
end
local events = scheduler.collect.all()
scheduler.systems.begin(events)
2024-08-29 23:18:42 +00:00
jabby.set_check_function(function(player)
return true
end)
if RunService:IsClient() then
2024-11-21 03:12:36 +00:00
local player = game:GetService("Players").LocalPlayer
local playergui = player:WaitForChild("PlayerGui")
local client = jabby.obtain_client()
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F4 then
2024-11-21 03:12:36 +00:00
local home = playergui:FindFirstChild("Home")
if home then
home:Destroy()
end
2024-11-21 03:12:36 +00:00
client.spawn_app(client.apps.home)
end
end)
2024-08-29 16:56:50 +00:00
end
end
return start