local ServerScriptService = game:GetService("ServerScriptService")
print("--- ЗАПУСК СЕРВЕРА ---")
-- Если папка Server лежит внутри ServerScriptService
local serverFolder = ServerScriptService:WaitForChild("Server", 5)
local services = serverFolder and serverFolder:FindFirstChild("Services") or ServerScriptService:FindFirstChild("Services")
if services then
for _, module in ipairs(services:GetChildren()) do
if module:IsA("ModuleScript") then
task.spawn(function()
local success, result = pcall(require, module)
if success then
print("[СЕРВЕР ОК]:", module.Name)
if type(result) == "table" then
if result.Init then result:Init() end
if result.Start then result:Start() end
end
else
warn("[ОШИБКА СЕРВЕРА]:", module.Name, result)
end
end)
end
end
else
warn("Не найдена папка Services в ServerScriptService!")
end