Multiplayer Framework Server-Authoritative | OOP | Modular
A complete, production ready multiplayer session framework for Roblox. Built with full OOP using Luau meta tables, every module is self-contained, independently testable, and designed to be extended without touching the internals.
---
What's Included
ReplicatedStorage/MultiplayerFramework/
- Config.lua — every tunable setting in one place. You edit this file only.
- Enums.lua — all state constants (GameState, PlayerState, TeamMode, EliminationReason)
- Signal.lua — lightweight custom signal class, no BindableEvent overhead
- Logger.lua — configurable log levels (DEBUG / INFO / WARN / ERROR / NONE)
- MPF_Client.lua — client-side hook API for UI integration
Core/
- Session.lua — the heart of the system. Owns all managers, fires all hooks
- MPlayer.lua — per-player state wrapper (score, team, round score, elimination)
- RoundManager.lua — round count, per-round timer, timeout handling
- TeamManager.lua — FFA / auto-balanced Teams / Custom assignment
- EliminationManager.lua — alive/eliminated tracking, win condition detection
- CharacterManager.lua — respawn blocking, death detection via Humanoid.Died
Services/
- EventBridge.lua — RemoteEvent abstraction with per-player rate limiting
- StatTracker.lua — DataStore read/write with pcall + 3x retry + BindToClose flush
- SessionRegistry.lua — global session map, disconnect handling, rejoin support
ServerScriptService/MultiplayerFramework/
- ServerAPI.lua — public server API, pre-creates all remotes on boot
- MPF_GameHandler.lua — buyer entry point, fully commented with hook markers
- init.server.lua — bootstrap (do not edit)
StarterPlayerScripts/MultiplayerFramework/
- init.client.lua — lobby UI, ready button, countdown, round feedback
---
OOP Architecture
Every class follows the same strict pattern:
local Session = {}
Session.__index = Session
function Session.new(hostPlayer, configOverrides)
local self = setmetatable({}, Session)
-- private fields use _camelCase
return self
end
function Session:Method() end
function Session
estroy() end -- zero leaks guaranteed
return Session
Private fields are prefixed _camelCase. Public methods have full type annotations. Every class has a working Destroy() that disconnects all connections, cancels all threads, and clears all tables.
---
Modular & Scalable
Each module has one responsibility and zero hidden dependencies. You can swap out any piece without touching the others:
- Replace TeamManager with your own bracket or custom matchmaking logic
- Replace EliminationManager with a lives-based or zone-control system
- Replace MPF_GameHandler entirely with your own session flow
- Add per-session config overrides without touching Config.lua:
local session = MPF.CreateSession(host, {
RoundTime = 60,
TeamMode = Enums.TeamMode.TEAMS,
MaxRounds = 3,
})
---
Hook System
Plug your game logic in without touching any internals:
session.OnRoundStart = function(activePlayers)
SpawnEnemies(activePlayers)
end
session.OnPlayerEliminated = function(mplayer, reason)
PlayEffect(mplayer:GetPlayer())
end
session.OnScoreChanged = function(mplayer, newScore, delta)
UpdateLeaderboard(mplayer, newScore)
end
session.OnSessionEnd = function(summary)
ShowEndScreen(summary.winner, summary.teamScores)
end
---
Features at a Glance
- Server-authoritative — clients never determine game state
- All players must ready up before game starts
- FFA, auto-balanced Teams, and Custom team modes
- Per-round and session-total score tracking
- DataStore persistence with retry logic and shutdown flush
- Rejoin support — disconnected players can return to their session
- Respawn blocking on elimination with optional spectator mode
- Rate-limited RemoteEvents — bad clients cannot crash the server
- Configurable log levels for clean production output
- Zero global state — no _G, no shared tables, no side effects on require
---
Setup — 4 Steps
1. Insert MPF_Core.rbxm into ReplicatedStorage
2. Insert MPF_Server.rbxm into ServerScriptService
3. Insert MPF_Client.rbxm into StarterPlayer > StarterPlayerScripts
4. Insert MPF_GUI.rbxm into StarterGui
5. Edit Config.lua — you're done
---
Works for any game genre combat, racing, quiz, party games, minigames. No UI included by design; buyers implement their own.
A complete, production ready multiplayer session framework for Roblox. Built with full OOP using Luau meta tables, every module is self-contained, independently testable, and designed to be extended without touching the internals.
---
What's Included
ReplicatedStorage/MultiplayerFramework/
- Config.lua — every tunable setting in one place. You edit this file only.
- Enums.lua — all state constants (GameState, PlayerState, TeamMode, EliminationReason)
- Signal.lua — lightweight custom signal class, no BindableEvent overhead
- Logger.lua — configurable log levels (DEBUG / INFO / WARN / ERROR / NONE)
- MPF_Client.lua — client-side hook API for UI integration
Core/
- Session.lua — the heart of the system. Owns all managers, fires all hooks
- MPlayer.lua — per-player state wrapper (score, team, round score, elimination)
- RoundManager.lua — round count, per-round timer, timeout handling
- TeamManager.lua — FFA / auto-balanced Teams / Custom assignment
- EliminationManager.lua — alive/eliminated tracking, win condition detection
- CharacterManager.lua — respawn blocking, death detection via Humanoid.Died
Services/
- EventBridge.lua — RemoteEvent abstraction with per-player rate limiting
- StatTracker.lua — DataStore read/write with pcall + 3x retry + BindToClose flush
- SessionRegistry.lua — global session map, disconnect handling, rejoin support
ServerScriptService/MultiplayerFramework/
- ServerAPI.lua — public server API, pre-creates all remotes on boot
- MPF_GameHandler.lua — buyer entry point, fully commented with hook markers
- init.server.lua — bootstrap (do not edit)
StarterPlayerScripts/MultiplayerFramework/
- init.client.lua — lobby UI, ready button, countdown, round feedback
---
OOP Architecture
Every class follows the same strict pattern:
local Session = {}
Session.__index = Session
function Session.new(hostPlayer, configOverrides)
local self = setmetatable({}, Session)
-- private fields use _camelCase
return self
end
function Session:Method() end
function Session
return Session
Private fields are prefixed _camelCase. Public methods have full type annotations. Every class has a working Destroy() that disconnects all connections, cancels all threads, and clears all tables.
---
Modular & Scalable
Each module has one responsibility and zero hidden dependencies. You can swap out any piece without touching the others:
- Replace TeamManager with your own bracket or custom matchmaking logic
- Replace EliminationManager with a lives-based or zone-control system
- Replace MPF_GameHandler entirely with your own session flow
- Add per-session config overrides without touching Config.lua:
local session = MPF.CreateSession(host, {
RoundTime = 60,
TeamMode = Enums.TeamMode.TEAMS,
MaxRounds = 3,
})
---
Hook System
Plug your game logic in without touching any internals:
session.OnRoundStart = function(activePlayers)
SpawnEnemies(activePlayers)
end
session.OnPlayerEliminated = function(mplayer, reason)
PlayEffect(mplayer:GetPlayer())
end
session.OnScoreChanged = function(mplayer, newScore, delta)
UpdateLeaderboard(mplayer, newScore)
end
session.OnSessionEnd = function(summary)
ShowEndScreen(summary.winner, summary.teamScores)
end
---
Features at a Glance
- Server-authoritative — clients never determine game state
- All players must ready up before game starts
- FFA, auto-balanced Teams, and Custom team modes
- Per-round and session-total score tracking
- DataStore persistence with retry logic and shutdown flush
- Rejoin support — disconnected players can return to their session
- Respawn blocking on elimination with optional spectator mode
- Rate-limited RemoteEvents — bad clients cannot crash the server
- Configurable log levels for clean production output
- Zero global state — no _G, no shared tables, no side effects on require
---
Setup — 4 Steps
1. Insert MPF_Core.rbxm into ReplicatedStorage
2. Insert MPF_Server.rbxm into ServerScriptService
3. Insert MPF_Client.rbxm into StarterPlayer > StarterPlayerScripts
4. Insert MPF_GUI.rbxm into StarterGui
5. Edit Config.lua — you're done
---
Works for any game genre combat, racing, quiz, party games, minigames. No UI included by design; buyers implement their own.
