Skip to content

Latest commit

ย 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SOS Modular Script System

A modular, GitHub-hosted Roblox executor script with clean dependency injection architecture, automatic cleanup on re-execution, and easy maintenance.

โœจ Features

  • โœ… 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

๐Ÿ“ Project Structure

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

๐Ÿ—๏ธ Architecture

Dependency Injection Pattern

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
end

Re-execution Cleanup

When the script is re-executed, it automatically:

  1. Finds previous runtime in _G.__SOS_RUNTIME
  2. Calls cleanup() on all modules
  3. Disconnects all connections
  4. Destroys all GUIs
  5. Stops all background loops
  6. 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!


๐Ÿš€ Setup Instructions

Step 1: Upload to GitHub

  1. Create a new GitHub repository (or use an existing one)
  2. Make sure your repository is PUBLIC
  3. Upload the entire SOS-Modular folder structure to your repository
  4. Note your repository URL

Step 2: Update URLs

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.

Step 3: Update Loader (Optional)

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"

Step 4: Test the URL

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! โœ…

Step 5: Run in Executor

  1. Copy the entire contents of loader_executor.lua
  2. Paste it into your Roblox executor
  3. Execute!

๐ŸŽฎ Usage

Hotkeys

  • H - Toggle HUD Menu
  • F - Toggle Flight
  • Tab - Toggle Leaderboard
  • CapsLock - Switch between custom/default leaderboard

HUD Features

  • Flight system with mobile support
  • Custom animations (float, fly, custom IDs)
  • Camera controls (FOV, shift lock)
  • Speed controls
  • Lighting effects
  • FPS counter

Tag System

  • 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

Leaderboard Features

  • 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

๐Ÿ”ง Customization

Adding Custom Roles

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) },
}

Modifying Theme

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...
}

Adding Flight Animation IDs

Edit utils/constants.lua:

Constants.DEFAULT_FLOAT_ID = "rbxassetid://YOUR_ANIMATION_ID"
Constants.DEFAULT_FLY_ID = "rbxassetid://YOUR_ANIMATION_ID"

๐Ÿ”„ Updating the Script

For Developers (You)

  1. Edit files in your GitHub repository
  2. Commit and push changes
  3. Changes are live immediately!

For Users

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

๐Ÿ› ๏ธ Adding New Modules

1. Create Module File

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 YourModule

2. Add to main.lua

Add 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
    })
end

3. Connection Tracking Rules

Always 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)

๐Ÿ› Troubleshooting

"Failed to fetch main.lua from GitHub"

  • Check your GitHub URL is correct
  • Ensure repository is PUBLIC
  • Verify the file path matches your repo structure
  • Try accessing URL directly in browser

"Module failed to load"

  • 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

Performance Degradation After Multiple Runs

  • This should not happen anymore! Re-execution cleanup prevents this.
  • If you still experience issues, check console for cleanup errors

Script Conflicts When Re-executing

  • This should not happen anymore! Cleanup disconnects all old connections.
  • If you experience duplicate inputs or tags, report as a bug

๐Ÿ“š Architecture Benefits

โœ… 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


๐Ÿ“Š File Checklist

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 private
  • SOS-non-Modular/ - Original reference files (ignored by git)

๐Ÿ“Š System Requirements

  • Executor: Any modern Roblox executor with HttpGet support
  • Optional: CoreModule for friend requests (leaderboard feature)
  • Internet: Required for loading from GitHub

๐Ÿ” Security Notes

  • 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

๐ŸŽฏ Current Version

v5.5 - Re-execution cleanup fully implemented

Recent Changes

  • โœ… 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

๐Ÿ“ž Support

If you encounter issues:

  1. Check all URLs are updated correctly in main.lua
  2. Verify files are uploaded to GitHub and public
  3. Test main.lua URL in browser before using in executor
  4. Check executor console for error messages
  5. Review technical documentation in this repo

Made with โค๏ธ for the SOS community

Powered by dependency injection and clean architecture

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages