A modular, GitHub-hosted Roblox executor script with clean dependency injection architecture, automatic cleanup on re-execution, and easy maintenance.
- โ Centralized Loading - All external links in one place (main.lua)
- โ Dependency Injection - Modules don't self-load, cleaner architecture
- โ Re-execution Cleanup - Run the script multiple times without conflicts or performance degradation
- โ Modular Design - Easy to maintain and extend
- โ GitHub Hosted - Update once, users auto-reload
- โ Full Featured - HUD, Flight, Custom Leaderboard, Tag System
SOS-Modular/
โโโ .gitignore # Git ignore rules
โโโ README.md # This file
โโโ loader_executor.lua # Entry point - run this in your executor
โโโ main.lua # Central orchestrator - loads & wires all modules
โ
โโโ modules/ # Feature modules (no internal links)
โ โโโ hud.lua # Main HUD system orchestrator
โ โโโ hud/ # HUD sub-modules
โ โ โโโ data.lua # Data structures
โ โ โโโ ui_builder.lua # UI components
โ โ โโโ lighting.lua # Lighting effects
โ โ โโโ animations.lua # Animation system
โ โ โโโ flight.lua # Flight physics
โ โ โโโ camera.lua # Camera controls
โ โ โโโ player.lua # Player modifications
โ โ โโโ ui_pages.lua # Menu pages
โ โโโ leaderboard.lua # Custom player leaderboard
โ โโโ tagsystem.lua # SOS tags activation system
โ
โโโ utils/ # Shared utilities (no internal links)
โโโ constants.lua # Shared constants, themes, configs
โโโ ui.lua # UI helper functions
โโโ settings.lua # Settings save/load system
โโโ chat.lua # Chat utilities
โโโ player.lua # Player utilities
All external links live in main.lua only.
Modules expose init(deps) functions and receive their dependencies:
-- โ OLD WAY (self-loading, creates conflicts on re-execution)
local Constants = loadstring(game:HttpGet("https://..."))()
-- โ
NEW WAY (dependency injection)
function Module.init(deps)
Constants = deps.Constants -- Injected by main.lua
endWhen the script is re-executed, it automatically:
- Finds previous runtime in
_G.__SOS_RUNTIME - Calls
cleanup()on all modules - Disconnects all connections
- Destroys all GUIs
- Stops all background loops
- Clears registry and starts fresh
Result: You can re-run the script as many times as you want without relaunching Roblox. Perfect for development and updates!
- Create a new GitHub repository (or use an existing one)
- Make sure your repository is PUBLIC
- Upload the entire
SOS-Modularfolder structure to your repository - Note your repository URL
You only need to update ONE file: main.lua
Open main.lua and replace the base URL (line 47):
-- BEFORE
local GITHUB_BASE_URL = "https://raw.githubusercontent.com/Artifaqt/SOS-Modular/refs/heads/main"
-- AFTER
local GITHUB_BASE_URL = "https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/refs/heads/main"That's it! All modules are loaded from this one URL.
If you want to use a different loader URL, update loader_executor.lua (line ~5):
local GITHUB_RAW_URL = "https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/refs/heads/main/main.lua"Before running in executor, test your URL in a browser:
https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/refs/heads/main/main.lua
If you see the Lua code, your URL is correct! โ
- Copy the entire contents of
loader_executor.lua - Paste it into your Roblox executor
- Execute!
- H - Toggle HUD Menu
- F - Toggle Flight
- Tab - Toggle Leaderboard
- CapsLock - Switch between custom/default leaderboard
- Flight system with mobile support
- Custom animations (float, fly, custom IDs)
- Camera controls (FOV, shift lock)
- Speed controls
- Lighting effects
- FPS counter
- Broadcast SOS: Bottom-left panel (owners/special users only)
- Activation marker: ๐บ
- Reply marker: ยฌ
- Auto-tags for SOS users, owners, testers, sins, OGs, custom roles
- Click tags to teleport behind player
- Click player entry to see options
- Teleport to player
- Send friend request (requires CoreModule)
- View avatar
- Mute/unmute voice chat
- Friend icons
- Draggable, resizable
- Special styling for owners
Edit utils/constants.lua:
-- Add owner
Constants.OwnerUserIds = {
[YOUR_USER_ID] = true,
}
-- Add custom tags
Constants.CustomTags = {
[USER_ID] = { TagText = "VIP", Color = Color3.fromRGB(255, 215, 0) },
}
-- Add Sin profiles
Constants.SinProfiles = {
[USER_ID] = { SinName = "Custom", Color = Color3.fromRGB(255, 0, 0) },
}
-- Add OG profiles
Constants.OgProfiles = {
[USER_ID] = { OgName = "OG Player", Color = Color3.fromRGB(100, 200, 255) },
}Edit utils/constants.lua to change colors:
Constants.THEME = {
GlassTop = Color3.fromRGB(18, 18, 22),
Red = Color3.fromRGB(200, 40, 40),
Text = Color3.fromRGB(245, 245, 245),
-- etc...
}Edit utils/constants.lua:
Constants.DEFAULT_FLOAT_ID = "rbxassetid://YOUR_ANIMATION_ID"
Constants.DEFAULT_FLY_ID = "rbxassetid://YOUR_ANIMATION_ID"- Edit files in your GitHub repository
- Commit and push changes
- Changes are live immediately!
Option 1: Re-execute (Recommended)
- Just run the script again in your executor
- Cleanup system handles everything automatically
- No need to rejoin game!
Option 2: Rejoin Game
- Works too, but re-execution is faster
Create modules/your_module.lua:
local YourModule = {}
-- Connection tracking for cleanup
YourModule.__connections = {}
-- Dependencies (injected by main.lua)
local Constants, UIUtils
-- Init function
function YourModule.init(deps)
deps = deps or {}
Constants = deps.Constants
UIUtils = deps.UIUtils
-- Your initialization code
local conn = game:GetService("Players").PlayerAdded:Connect(function(player)
-- ...
end)
table.insert(YourModule.__connections, conn)
end
-- Cleanup function
function YourModule.cleanup()
for _, c in ipairs(YourModule.__connections) do
pcall(function() c:Disconnect() end)
end
YourModule.__connections = {}
-- Destroy your GUIs, etc.
end
return YourModuleAdd your module URL to MODULES table:
local MODULES = {
-- ... existing modules ...
your_module = GITHUB_BASE_URL .. "/modules/your_module.lua",
}Load and initialize:
local YourModule = Main.loadModule("your_module", MODULES.your_module)
RUNTIME.modules["your_module"] = YourModule
if YourModule and YourModule.init then
YourModule.init({
Constants = Constants,
UIUtils = UIUtils,
-- ... other dependencies
})
endAlways track connections:
local conn = something:Connect(function() ... end)
table.insert(ModuleName.__connections, conn)For spawn() loops:
spawn(function()
while condition and not ModuleName.__cleanupRequested do
-- work
if ModuleName.__cleanupRequested then break end
end
end)- Check your GitHub URL is correct
- Ensure repository is PUBLIC
- Verify the file path matches your repo structure
- Try accessing URL directly in browser
- Check console output for specific module name
- Verify all files are uploaded to GitHub
- Check for typos in file names (case-sensitive!)
- Make sure main.lua GITHUB_BASE_URL is correct
- This should not happen anymore! Re-execution cleanup prevents this.
- If you still experience issues, check console for cleanup errors
- This should not happen anymore! Cleanup disconnects all old connections.
- If you experience duplicate inputs or tags, report as a bug
โ Single Source of Truth - All URLs in main.lua โ No Circular Dependencies - Clean dependency flow โ Easy Testing - Modules can be tested in isolation โ Re-execution Safe - Cleanup prevents conflicts โ Performance Stable - No connection/loop leaks โ Maintainable - Clear module boundaries โ Scalable - Easy to add features
Before uploading to GitHub, make sure these files exist:
Required Files:
- โ
loader_executor.lua- Script entry point - โ
main.lua- Central orchestrator - โ
README.md- Documentation
Utils Folder:
- โ
utils/constants.lua - โ
utils/ui.lua - โ
utils/settings.lua - โ
utils/chat.lua - โ
utils/player.lua
Modules Folder:
- โ
modules/hud.lua - โ
modules/leaderboard.lua - โ
modules/tagsystem.lua
HUD Sub-modules:
- โ
modules/hud/data.lua - โ
modules/hud/ui_builder.lua - โ
modules/hud/lighting.lua - โ
modules/hud/animations.lua - โ
modules/hud/flight.lua - โ
modules/hud/camera.lua - โ
modules/hud/player.lua - โ
modules/hud/ui_pages.lua
Optional (can ignore):
.gitignore- Keeps local files privateSOS-non-Modular/- Original reference files (ignored by git)
- Executor: Any modern Roblox executor with HttpGet support
- Optional: CoreModule for friend requests (leaderboard feature)
- Internet: Required for loading from GitHub
- All scripts are visible in this public repository
- No obfuscation, fully readable code
- Review code before executing (as you should with any script)
- GitHub URLs use HTTPS
v5.5 - Re-execution cleanup fully implemented
- โ Centralized all external links in main.lua
- โ Implemented dependency injection architecture
- โ Added re-execution cleanup system
- โ Fixed GUI location bugs
- โ Added connection tracking to all modules
- โ Added spawn() loop cleanup flags
- โ Performance stable across multiple re-executions
If you encounter issues:
- Check all URLs are updated correctly in main.lua
- Verify files are uploaded to GitHub and public
- Test main.lua URL in browser before using in executor
- Check executor console for error messages
- Review technical documentation in this repo
Made with โค๏ธ for the SOS community
Powered by dependency injection and clean architecture