A lightweight Roblox framework that manages modules and remote communication through a clear, structured lifecycle. Each module follows a defined flow—Import → Init → Start → PlayerAdded/Removing—ensuring consistent initialization, safe execution (no yielding in Init), and scalable expansion.
Note: The built-in networking is very basic and not meant for production. Use something more robust like Blink.
[dependencies]
SimpleFramework = "sstunickss/simpleframework@1.1.6"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SimpleFramework = require(ReplicatedStorage.SimpleFramework)
SimpleFramework:Import({
ReplicatedStorage.Controllers
})local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local SimpleFramework = require(ReplicatedStorage.SimpleFramework)
SimpleFramework:Import({
ServerScriptService.Services
})function ExampleModule:Init(): ()
-- Called when the module is first imported; used for setup.
end
function ExampleModule:Start(): ()
-- Called after all modules have been initialized; used for starting processes.
end
function ExampleModule.PlayerAdded(player: Player): ()
-- Called when a player joins the game
end
function ExampleModule.PlayerRemoving(player: Player): ()
-- Called when a player leaves the game
endlocal ReplicatedStorage = game:GetService("ReplicatedStorage")
local SimpleFramework = require(ReplicatedStorage.SimpleFramework)
local Remote1 = SimpleFramework:CreateSignal("Remote1", "Reliable")
local Service = {}
function Service:Init()
print("Server Init")
end
function Service:Start()
print("Server Start")
Remote1:Connect(function(player, var)
print(player, var)
end)
end
return Servicelocal ReplicatedStorage = game:GetService("ReplicatedStorage")
local SimpleFramework = require(ReplicatedStorage.SimpleFramework)
local Remote1 = SimpleFramework.Remotes.Service.Remote1 :: SimpleFramework.ClientRemote
local Controller = {}
function Controller:Init()
print("Controller Init")
end
function Controller:Start()
print("Controller Start")
Remote1:Fire('Hello')
end
return Controller