>_ scriptsbin
Murder Mystery 2 icon

Murder Mystery 2 Scripts  — all 38 in one page

undetected 29 keyless 9 key required survival updated 2 Nov 2026

Murder Mystery 2 runs on three roles, which is what the scripts here target: role ESP so you know who the murderer is, silent aim for the sheriff's revolver, and auto-pickup so the gun never lands on the floor next to you. Kill aura and coin farm sit lower down the list.

MM2 rounds are short, so a loader that takes ten seconds to open is a loader you will not use. The blocks with the highest votes all attach fast — if one sits on a loading screen past the round start, it is dead and the next entry is the one to copy.

Note. Most MM2 guis bind to a key. The bind is printed above the loader — read it before you paste, then press it after executing.

02

rblxhub MM2 Keyless script | Kill aura, Auto Shoot, Highlight ESP, Teleport, Fling Players)

keyless working mobile Murderer (Kill aura, Kill everyone, etc.)Sheriff (Auto shoot, Shoot murderer, etc.)Teleport

This Roblox Murder Mystery 2 script rblxhub is free and requires no key!An early test version, will be improved depending on feedback

loadstring(game:HttpGet("https://raw.githubusercontent.com/bugxiefun/roblox-scripts/refs/heads/main/rblxhub_mm2"))()
raw.githubusercontent.com updated 2 Nov 2026 31.6k views 46 loader source ↗
03

MM2 Spark Hub | KILL ALL, AIMBOT, AUTO FARM, TELEPORT and more (Keyless GUI)

keyless working mobile Combat FeaturesVisualsMovementTelpeortAuto FarmingConfigsand more

Roblox script Spark Hub for Murder Mystery 2 with a huge list of great features!The script requires no key

loadstring(game:HttpGet("https://raw.githubusercontent.com/ultimatep568/Spark-Hub/refs/heads/main/SparkHub_Loader.lua"))()
by Spark Hub raw.githubusercontent.com updated 2 Nov 2026 31k views 29 loader source ↗
04

[ 🎃 ] Happy Hub by replicated man fully free

keyless working mobile Highlights, nametags, murderer beam, Gun espAvatar custom anim pack, Korblox for r15Coin farm, evade murderer, coin label in live

This script is keyless and fully free! enjoy it.

loadstring(game:HttpGet("https://raw.githubusercontent.com/overthcode2011-stack/HHB/refs/heads/main/MurderMistery.lua"))()
raw.githubusercontent.com updated 2 Nov 2026 7.4k views 28 loader source ↗
05

Foxname MM2 Script -The best UpTo date. Undetected

keyless working mobile

The best mm2 script so far with many features that updates every single time. Easy to use. Keyless and also undetected (If u use it well)

loadstring(game:HttpGet("https://raw.githubusercontent.com/xv3gasx"))()
raw.githubusercontent.com updated 2 Nov 2026 10.8k views 19 loader source ↗
06

MM2 GUI - Auto Farm, Kill All, Auto Grab Gun, Visual ESP, Silent Aimbot

keyless working Auto FarmKill AllShoot MurderAuto Grab GunVisual ESP ChamsSilent AimbotLocal Player

Roblox Murder Mystery 2 powerful script! Enjoy effortless gameplay with features like Auto Farm, Kill All, Auto Grab Gun, Visual ESP to detect hidden players, and Silent Aimbot for precise targeting. Dominate the game with ease and become the ultimate detective or killer!

loadstring(game:HttpGet("https://raw.githubusercontent.com/renardofficiel/game/refs/heads/main/MurderMystery2/main.lua", true))()
raw.githubusercontent.com updated 2 Nov 2026 18.1k views 14 loader source ↗
07

MM2 Coin Autofarm GUI (Keyless)

keyless working mobile Coin Auto FarmAnti AFKFarming Stats

Simple Script for Roblox Murder Mystery 2 (MM2) that allows you to auto farm coins.

loadstring(game:HttpGet("https://raw.githubusercontent.com/bugxiefun/roblox-scripts/refs/heads/main/MM2%20Coin%20Autofarm", true))()
raw.githubusercontent.com updated 2 Nov 2026 7.1k views 14 loader source ↗
08

Foxname Murder Mystery 2 script by x.v3gas.x

keyless working mobile

Foxname Murder Mystery 2 script is one of the best Murder Mystery 2 script ever. It has lots of useful features as: Coin Farm, Auto Prestige, Aimlock, Auto Shoot, Auto Throw knife, Auto Bomb Jump, Speed Glitch and much more you can explore by using it. The script is being updated constantly by me with a lot of new feat

loadstring(game:HttpGet("https://raw.githubusercontent.com/xv3gasx"))()
raw.githubusercontent.com updated 2 Nov 2026 3.7k views 14 loader source ↗
09

[KEYLESS] Auto-Farm, AimBot, ESP, Kill All, Fling, Invisibility + More | Vertex

keyless working mobile Auto-FarmSilent AimESP (Players & Weapons)Instant KillHitbox ExpanderEnd RoundFling Target

Vertex is a premium script hub that supports several games; in Murder Mystery 2, it is a powerful option that is keyless and much stronger than other scripts. It comes with many features that help with auto-farming, or just being OP in games.

loadstring(game:HttpGet('https://raw.smokingscripts.org/vertex.lua'))()
raw.smokingscripts.org updated 2 Nov 2026 10.7k views 13 loader source ↗
11

🥶ALL EXCLUSIVE SKINS + EMOTES🥶 | 🔥KILL AURA🔥 | 💀KILL ALL💀 | 🔫AUTO SHOOT🔫 | 🎯AIMBOT🎯

key system working mobile

Dominate every match with this powerful script! Unlock all exclusive skins and emotes, use Kill Aura and Kill All to eliminate enemies instantly, and take your gameplay to the next level with Auto Shoot and Aimbot. Fast, easy to use, and packed with powerful features!

loadstring(game:HttpGet("https://raw.githubusercontent.com/QuantumNode-js/Chituk-corp-/refs/heads/main/Loader.lua"))()
raw.githubusercontent.com updated 2 Nov 2026 2.4k views 11 loader source ↗
12

Sw1nium MM2 v1.3 • NO BAN & God Mode

keyless working

⚔️ Combat• Kill All • Silent Aim • Auto Shoot • Auto Grab • Auto Stab

loadstring(game:HttpGet("https://raw.githubusercontent.com/musha9melnykmuhail-bot/Sw1nium_V1.3/refs/heads/main/Recode"))()
raw.githubusercontent.com updated 2 Nov 2026 7k views 10 loader source ↗
13

Overflow Aimbot, Kill All, Knife Aura & More

key system working mobile

🔫 Auto Pick Up Gun🪙 Auto Pick Up Coins💀 Auto Kill All🌪️ Fling Player🤸 Auto Fling Murderer⚔️ Kill All🔪 Knife Aura (Range Slider)🎯 Aimbot (FOV Slider, Keybind)🏹 Silent Aim (FOV Slider)🔴 Murderer ESP (Boxes, Tracers, Color)⭐ Sheriff ESP (Boxes, Tracers, Color)👤 Innocent ESP (Boxes, Tracers, Color)📦 Dropped Gun

loadstring(game:HttpGet("https://overflow.cx/loader.lua"))()
overflow.cx updated 2 Nov 2026 4.7k views 10 loader source ↗
14

MM2 Sw1nium v1.1 Free/No ban

keyless working

🔥 Sw1nium v1.1 — MM2 Script Loader

loadstring(game:HttpGet("https://raw.githubusercontent.com/musha9melnykmuhail-bot/Sw1nium-Flash/refs/heads/main/V1.0"))()
raw.githubusercontent.com updated 2 Nov 2026 3.1k views 10 loader source ↗
15

Pulse hub script murder mystery best

keyless working mobile

Buttons: shoot murder, Invisible, kill all, bhop,fling murder, throw knife,fling sheriff

loadstring(game:HttpGet("https://api.luarmor.net/files/v4/loaders/5857a6cfae3b902eb3c2dff7cdbf173b.lua"))()
api.luarmor.net updated 2 Nov 2026 4.4k views 9 loader source ↗
18

(KEYLESS) MM2 OP AUTOFARM PANEL

keyless working mobile

auto checks the role and auto : hides,kills,shoot its completly free and keylesss

loadstring(game:HttpGet("https://pastefy.app/xA1rNaxN/raw"))()
pastefy.app updated 2 Nov 2026 3k views 7 loader source ↗
19

Identical | Silent Aim, Esp, Autofarm, Fling+Protection, more

keyless working CombatESP & VisualsSurvival & DefenseFarmingTeleports & Trolling

Hitbox Expander & Aim Assistance

loadstring(readfile("Identical_MM2.lua"))()
inline updated 2 Nov 2026 3.3k views 6
full source (122160 chars)
    if getgenv and getgenv().IdenticalMM2Unload then
        pcall(getgenv().IdenticalMM2Unload)
    end

    local Players = game:GetService("Players")
    local Workspace = game:GetService("Workspace")
    local RunService = game:GetService("RunService")
    local UserInputService = game:GetService("UserInputService")
    local TweenService = game:GetService("TweenService")
    local HttpService = game:GetService("HttpService")
    local CoreGui = game:GetService("CoreGui")
    local Lighting = game:GetService("Lighting")
    local TeleportService = game:GetService("TeleportService")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")
    local TextChatService = game:GetService("TextChatService")

    local LocalPlayer = Players.LocalPlayer
    local Camera = Workspace.CurrentCamera

    local Config = {
        RoundTimer = true,
        DeathNotifs = true,
        RoleReveals = true,
        AnnounceRoles = false,

        AutoShoot = false,
        SilentAim = false,
        AimPrediction = true,
        PingComp = true,
        SingleShot = false,
        FOVRadius = 160,
        ShowFOV = false,
        AutoEquipGun = true,
        GrabGunAuto = false,
        GunGrabDist = 300,

        KillAura = false,
        AutoKill = false,
        KillMode = "Legit",
        KnifeSilentAim = true,
        AuraRange = 15,
        KillAll = false,
        ShowAuraRing = false,
        AutoEquipKnife = true,
        ProximityKnife = true,
        KnifeProxDist = 18,

        HitboxExpander = false,
        HitboxSize = 10,
        HitboxTransparency = 0.6,

        MurdererAvoid = false,
        SafetyRadius = 40,
        RetreatToLobby = false,
        ProximityAlert = true,
        SprintWhenChased = true,
        FollowMurderer = false,
        FollowDist = 18,

        RoleESP = true,
        ESPBoxes = true,
        ESPNames = true,
        ESPTracers = false,
        ESPDistance = true,
        ESPChams = true,
        ESPDistanceMax = 600,
        GunESP = true,
        CoinESP = true,

        CoinFarm = false,
        FarmSpeed = 28,
        FarmMethod = "Glide",
        SafeCoinFarm = true,
        BagFullStop = true,
        QuickFarm = false,
        CoinBagCap = 40,

        FlingStyle = "Torque",
        FlingPower = 90,

        AutoDrop = false,
        SaveSlot1 = nil,
        SaveSlot2 = nil,

        SpeedEnabled = false,
        SpeedValue = 24,
        JumpEnabled = false,
        JumpValue = 50,
        InfiniteJump = false,
        Noclip = false,
        Fly = false,
        FlySpeed = 35,

        AntiVoid = true,
        AntiFling = true,
        Fullbright = false,
        NoFog = false,
        DisableParticles = false,
        AntiAFK = true,

        AutoPlay = false
    }

    local DefaultConfig = {}
    for k, v in pairs(Config) do
        DefaultConfig[k] = v
    end

    local CONFIG_FILE = "Identical/mm2_config.json"

    local function LoadSavedConfig()
        if isfile and isfile(CONFIG_FILE) then
            local ok, data = pcall(function()
                return HttpService:JSONDecode(readfile(CONFIG_FILE))
            end)
            if ok and type(data) == "table" then
                for k, v in pairs(data) do
                    if Config[k] ~= nil then
                        if type(v) == "table" and (k == "SaveSlot1" or k == "SaveSlot2") then
                            Config[k] = CFrame.new(unpack(v))
                        else
                            Config[k] = v
                        end
                    end
                end
                return true
            end
        end
        return false
    end

    local saveDebounce = false
    local function AutoSaveConfig()
        if not writefile then return end
        if saveDebounce then return end
        saveDebounce = true
        task.delay(0.25, function()
            saveDebounce = false
            pcall(function()
                if makefolder and not isfolder("Identical") then
                    makefolder("Identical")
                end
                local payload = {}
                for k, v in pairs(Config) do
                    if typeof(v) == "CFrame" then
                        payload[k] = {v:GetComponents()}
                    elseif typeof(v) == "EnumItem" then
                        payload[k] = v.Name
                    else
                        payload[k] = v
                    end
                end
                writefile(CONFIG_FILE, HttpService:JSONEncode(payload))
            end)
        end)
    end

    LoadSavedConfig()

    local isSyncingUI = false
    local SyncUIWithConfig = nil
    local ctrls = {}

    local Colors = {
        Background = Color3.fromRGB(13, 11, 20),
        SidebarBg = Color3.fromRGB(11, 9, 17),
        CardBg = Color3.fromRGB(19, 16, 28),
        ControlBg = Color3.fromRGB(26, 22, 38),
        BorderPurple = Color3.fromRGB(88, 48, 145),
        PurplePrimary = Color3.fromRGB(192, 132, 252),
        PurpleAccent = Color3.fromRGB(168, 85, 247),
        PurpleDark = Color3.fromRGB(58, 28, 92),
        PurpleGlow = Color3.fromRGB(147, 51, 234),
        PurpleMuted = Color3.fromRGB(120, 85, 160),
        TextPrimary = Color3.fromRGB(243, 240, 255),
        TextMuted = Color3.fromRGB(140, 130, 165),
        TextSubtle = Color3.fromRGB(95, 88, 118),
        Divider = Color3.fromRGB(35, 30, 52),
        AccentGreen = Color3.fromRGB(52, 211, 153),
        AccentRed = Color3.fromRGB(248, 113, 113),
        AccentBlue = Color3.fromRGB(96, 165, 250),
        AccentYellow = Color3.fromRGB(251, 191, 36)
    }

    local espFolder = CoreGui:FindFirstChild("Identical_MM2_ESP") or LocalPlayer.PlayerGui:FindFirstChild("Identical_MM2_ESP")
    if not espFolder then
        espFolder = Instance.new("Folder")
        espFolder.Name = "Identical_MM2_ESP"
        pcall(function() espFolder.Parent = CoreGui end)
        if not espFolder.Parent then espFolder.Parent = LocalPlayer.PlayerGui end
    end

    local activeConnections = {}
    local trackedESPElements = {}
    local deadPlayersList = {}
    local originalHitboxSizes = {}
    local isFlinging = false

    local function fireTouch(part1, part2)
        if firetouchinterest and part1 and part2 then
            local ft = firetouchinterest
            pcall(ft, part1, part2, true)
            pcall(ft, part1, part2, 0)
            task.wait()
            pcall(ft, part1, part2, false)
            pcall(ft, part1, part2, 1)
        end
    end

    local trackedTracers = {}

    local function clearESPCategory(prefix)
        local toRemove = {}
        for id in pairs(trackedESPElements) do
            if string.sub(id, 1, string.len(prefix)) == prefix then
                table.insert(toRemove, id)
            end
        end
        for _, id in ipairs(toRemove) do
            if trackedESPElements[id] then
                pcall(function() trackedESPElements[id]:Destroy() end)
                trackedESPElements[id] = nil
            end
        end
        local tracersToRemove = {}
        for id in pairs(trackedTracers) do
            if string.sub(id, 1, string.len(prefix)) == prefix then
                table.insert(tracersToRemove, id)
            end
        end
        for _, id in ipairs(tracersToRemove) do
            if trackedTracers[id] then
                pcall(function() trackedTracers[id]:Remove() end)
                trackedTracers[id] = nil
            end
        end
        for _, c in ipairs(espFolder:GetChildren()) do
            if string.sub(c.Name, 1, string.len(prefix)) == prefix then
                pcall(function() c:Destroy() end)
            end
        end
    end

    local function getRootPart(char)
        if not char then return nil end
        return char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or char:FindFirstChildWhichIsA("BasePart")
    end

    local function getHumanoid(char)
        if not char then return nil end
        return char:FindFirstChildOfClass("Humanoid")
    end

    local function isPlayerAlive(p)
        if not p or not p.Character then return false end
        local hum = getHumanoid(p.Character)
        return hum ~= nil and hum.Health > 0
    end

    local function getPlayerRole(p)
        if not p then return "Innocent" end
        local bp = p:FindFirstChild("Backpack")
        local char = p.Character
        local knife = (bp and bp:FindFirstChild("Knife")) or (char and char:FindFirstChild("Knife"))
        local gun = (bp and bp:FindFirstChild("Gun")) or (char and char:FindFirstChild("Gun"))
        if knife then
            return "Murderer"
        elseif gun then
            return "Sheriff"
        end
        return "Innocent"
    end

    local function getRolePlayers()
        local murderer = nil
        local sheriff = nil
        local innocents = {}

        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) then
                local r = getPlayerRole(p)
                if r == "Murderer" then
                    murderer = p
                elseif r == "Sheriff" then
                    sheriff = p
                else
                    table.insert(innocents, p)
                end
            end
        end
        return murderer, sheriff, innocents
    end

    local function getActiveMap()
        for _, c in ipairs(Workspace:GetChildren()) do
            if c:IsA("Model") and not string.find(string.lower(c.Name), "lobby") and not Players:GetPlayerFromCharacter(c) then
                if c:FindFirstChild("Spawns") or c:FindFirstChild("CoinAreas") or c:FindFirstChild("CoinContainer") or c:FindFirstChild("Base") then
                    return c
                end
            end
        end
        return nil
    end

    local function getLobbyModel()
        for _, c in ipairs(Workspace:GetChildren()) do
            if c:IsA("Model") and string.find(string.lower(c.Name), "lobby") then
                return c
            end
        end
        return Workspace:FindFirstChild("SummerLobby") or Workspace:FindFirstChild("Lobby")
    end

    local function getAllActiveCoins()
        local coins = {}
        local seen = {}
        local CollectionService = game:GetService("CollectionService")

        for _, tag in ipairs({"CoinVisual", "Coin"}) do
            for _, v in ipairs(CollectionService:GetTagged(tag)) do
                if v and v.Parent and not v:GetAttribute("Collected") and not v:GetAttribute("Delete") then
                    local part = v:IsA("BasePart") and v or v:FindFirstChildWhichIsA("BasePart")
                    if part and not seen[part] and part.Transparency < 0.95 then
                        seen[part] = true
                        table.insert(coins, part)
                    end
                end
            end
        end

        if #coins == 0 then
            local map = getActiveMap()
            if map then
                local container = map:FindFirstChild("CoinAreas") or map:FindFirstChild("CoinContainer") or map:FindFirstChild("Coins")
                if container then
                    for _, c in ipairs(container:GetChildren()) do
                        for _, d in ipairs(c:GetDescendants()) do
                            if (d:GetAttribute("CoinID") or string.find(string.lower(d.Name), "coin")) and d:IsA("BasePart") and not seen[d] and d.Transparency < 0.95 then
                                seen[d] = true
                                table.insert(coins, d)
                            end
                        end
                        if (c:GetAttribute("CoinID") or string.find(string.lower(c.Name), "coin")) and c:IsA("BasePart") and not seen[c] and c.Transparency < 0.95 then
                            seen[c] = true
                            table.insert(coins, c)
                        end
                    end
                end
            end
        end

        return coins
    end

    local function getCurrentCoinCount()
        local pgui = LocalPlayer:FindFirstChild("PlayerGui")
        local mg = pgui and pgui:FindFirstChild("MainGUI")
        local gameUi = mg and mg:FindFirstChild("Game")
        local coinBag = gameUi and gameUi:FindFirstChild("CoinBag")
        if coinBag then
            for _, desc in ipairs(coinBag:GetDescendants()) do
                if desc:IsA("TextLabel") and string.find(desc.Text, "/") then
                    local current = tonumber(string.match(desc.Text, "(%d+)%s*/"))
                    if current then
                        return current
                    end
                end
            end
        end
        return 0
    end

    local function getGunDrop()
        local gd = Workspace:FindFirstChild("GunDrop")
        if gd then return gd end
        local map = getActiveMap()
        if map then
            gd = map:FindFirstChild("GunDrop")
            if gd then return gd end
        end
        for _, c in ipairs(Workspace:GetChildren()) do
            if c.Name == "GunDrop" then
                return c
            end
        end
        return Workspace:FindFirstChild("GunDrop", true)
    end

    local function getGunDropPart(drop)
        if not drop then return nil end
        if drop:IsA("BasePart") then
            return drop
        end
        if drop:IsA("Model") or drop:IsA("Folder") or drop:IsA("Tool") then
            local p = drop:FindFirstChild("GunDrop") or drop:FindFirstChild("Handle") or drop.PrimaryPart or drop:FindFirstChildWhichIsA("BasePart")
            if p and p:IsA("BasePart") then
                return p
            end
            for _, desc in ipairs(drop:GetDescendants()) do
                if desc:IsA("BasePart") then
                    return desc
                end
            end
        end
        return nil
    end

    local function interactWithGunDrop(gunPart, gunObj)
        if not gunPart then return end
        local char = LocalPlayer.Character
        if not char then return end
        local root = getRootPart(char)
        if not root then return end

        local prompt = (gunObj and gunObj:FindFirstChildOfClass("ProximityPrompt"))
            or gunPart:FindFirstChildOfClass("ProximityPrompt")
            or (gunObj and gunObj:FindFirstChildWhichIsA("ProximityPrompt", true))
        if prompt and fireproximityprompt then
            pcall(fireproximityprompt, prompt)
        end

        fireTouch(root, gunPart)
        local rHand = char:FindFirstChild("RightHand") or char:FindFirstChild("Right Arm")
        if rHand then
            fireTouch(rHand, gunPart)
        end
    end

    local screenGui = Instance.new("ScreenGui")
    screenGui.Name = "Identical"
    screenGui.ResetOnSpawn = false
    screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
    pcall(function() screenGui.Parent = CoreGui end)
    if not screenGui.Parent then screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end

    local uiVisible = true
    local isMinimized = false

    local function SendNotification(title, text, duration)
        duration = duration or 3
        local noteHolder = screenGui:FindFirstChild("NotificationHolder")
        if not noteHolder then
            noteHolder = Instance.new("Frame")
            noteHolder.Name = "NotificationHolder"
            noteHolder.Size = UDim2.new(0, 240, 1, -40)
            noteHolder.Position = UDim2.new(1, -250, 0, 20)
            noteHolder.BackgroundTransparency = 1
            noteHolder.Parent = screenGui

            local noteList = Instance.new("UIListLayout")
            noteList.SortOrder = Enum.SortOrder.LayoutOrder
            noteList.VerticalAlignment = Enum.VerticalAlignment.Bottom
            noteList.Padding = UDim.new(0, 8)
            noteList.Parent = noteHolder
        end

        local card = Instance.new("Frame")
        card.Size = UDim2.new(1, 0, 0, 56)
        card.BackgroundColor3 = Colors.CardBg
        card.BorderSizePixel = 0
        card.Position = UDim2.new(1, 20, 0, 0)
        card.Parent = noteHolder

        local cardCorner = Instance.new("UICorner")
        cardCorner.CornerRadius = UDim.new(0, 6)
        cardCorner.Parent = card

        local cardStroke = Instance.new("UIStroke")
        cardStroke.Color = Colors.BorderPurple
        cardStroke.Thickness = 1
        cardStroke.Parent = card

        local topBar = Instance.new("Frame")
        topBar.Size = UDim2.new(1, -20, 0, 18)
        topBar.BackgroundTransparency = 1
        topBar.Position = UDim2.new(0, 10, 0, 6)
        topBar.Parent = card

        local tLabel = Instance.new("TextLabel")
        tLabel.Size = UDim2.new(1, -20, 1, 0)
        tLabel.BackgroundTransparency = 1
        tLabel.Font = Enum.Font.GothamBold
        tLabel.Text = title
        tLabel.TextColor3 = Colors.PurplePrimary
        tLabel.TextSize = 13
        tLabel.TextXAlignment = Enum.TextXAlignment.Left
        tLabel.Parent = topBar

        local mLabel = Instance.new("TextLabel")
        mLabel.Size = UDim2.new(1, -20, 0, 26)
        mLabel.Position = UDim2.new(0, 10, 0, 26)
        mLabel.BackgroundTransparency = 1
        mLabel.Font = Enum.Font.Gotham
        mLabel.Text = text
        mLabel.TextColor3 = Colors.TextSubtle
        mLabel.TextSize = 11
        mLabel.TextXAlignment = Enum.TextXAlignment.Left
        mLabel.TextWrapped = true
        mLabel.Parent = card

        task.delay(duration, function()
            TweenService:Create(card, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
                BackgroundTransparency = 1,
                Position = card.Position + UDim2.new(1, 20, 0, 0)
            }):Play()
            task.wait(0.35)
            card:Destroy()
        end)
    end

    local ToggleUiVisibility

    local floatingCrescent = Instance.new("ImageButton")
    floatingCrescent.Name = "FloatingCrescent"
    floatingCrescent.Size = UDim2.new(0, 44, 0, 44)
    floatingCrescent.Position = UDim2.new(0, 20, 0, 20)
    floatingCrescent.BackgroundColor3 = Colors.Background
    floatingCrescent.BorderSizePixel = 0
    floatingCrescent.Visible = false
    floatingCrescent.ZIndex = 1000
    floatingCrescent.Parent = screenGui

    local fcCorner = Instance.new("UICorner")
    fcCorner.CornerRadius = UDim.new(1, 0)
    fcCorner.Parent = floatingCrescent

    local fcStroke = Instance.new("UIStroke")
    fcStroke.Color = Colors.PurpleAccent
    fcStroke.Thickness = 1.5
    fcStroke.Parent = floatingCrescent

    local fcIconContainer = Instance.new("Frame")
    fcIconContainer.Name = "Icon"
    fcIconContainer.Size = UDim2.new(0, 24, 0, 24)
    fcIconContainer.Position = UDim2.new(0.5, -12, 0.5, -12)
    fcIconContainer.BackgroundTransparency = 1
    fcIconContainer.ClipsDescendants = true
    fcIconContainer.Parent = floatingCrescent

    local fcOuter = Instance.new("Frame")
    fcOuter.Name = "Outer"
    fcOuter.Size = UDim2.new(0, 24, 0, 24)
    fcOuter.BackgroundColor3 = Colors.PurplePrimary
    fcOuter.BorderSizePixel = 0
    fcOuter.Parent = fcIconContainer

    local fcOuterCorner = Instance.new("UICorner")
    fcOuterCorner.CornerRadius = UDim.new(1, 0)
    fcOuterCorner.Parent = fcOuter

    local fcCutout = Instance.new("Frame")
    fcCutout.Name = "Cutout"
    fcCutout.Size = UDim2.new(0, 20, 0, 20)
    fcCutout.Position = UDim2.new(0, 6, 0, -3)
    fcCutout.BackgroundColor3 = Colors.Background
    fcCutout.BorderSizePixel = 0
    fcCutout.Parent = fcOuter

    local fcCutoutCorner = Instance.new("UICorner")
    fcCutoutCorner.CornerRadius = UDim.new(1, 0)
    fcCutoutCorner.Parent = fcCutout

    local fcDragging = false
    local fcDragInput, fcDragStart, fcStartPos

    floatingCrescent.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            fcDragging = true
            fcDragStart = input.Position
            fcStartPos = floatingCrescent.Position
            input.Changed:Connect(function()
                if input.UserInputState == Enum.UserInputState.End then
                    fcDragging = false
                end
            end)
        end
    end)

    floatingCrescent.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseMovement then
            fcDragInput = input
        end
    end)

    UserInputService.InputChanged:Connect(function(input)
        if input == fcDragInput and fcDragging then
            local delta = input.Position - fcDragStart
            floatingCrescent.Position = UDim2.new(fcStartPos.X.Scale, fcStartPos.X.Offset + delta.X, fcStartPos.Y.Scale, fcStartPos.Y.Offset + delta.Y)
        end
    end)

    floatingCrescent.MouseEnter:Connect(function()
        TweenService:Create(floatingCrescent, TweenInfo.new(0.15), {BackgroundColor3 = Colors.PurpleDark}):Play()
        TweenService:Create(fcStroke, TweenInfo.new(0.15), {Color = Colors.PurpleGlow}):Play()
        fcCutout.BackgroundColor3 = Colors.PurpleDark
    end)

    floatingCrescent.MouseLeave:Connect(function()
        TweenService:Create(floatingCrescent, TweenInfo.new(0.15), {BackgroundColor3 = Colors.Background}):Play()
        TweenService:Create(fcStroke, TweenInfo.new(0.15), {Color = Colors.PurpleAccent}):Play()
        fcCutout.BackgroundColor3 = Colors.Background
    end)

    floatingCrescent.MouseButton1Click:Connect(function()
        if ToggleUiVisibility then ToggleUiVisibility() end
    end)

    local mainFrame = Instance.new("Frame")
    mainFrame.Name = "MainFrame"
    mainFrame.Size = UDim2.new(0, 690, 0, 470)
    mainFrame.Position = UDim2.new(0.5, -345, 0.5, -235)
    mainFrame.BackgroundColor3 = Colors.Background
    mainFrame.BorderSizePixel = 0
    mainFrame.Parent = screenGui

    local mainCorner = Instance.new("UICorner")
    mainCorner.CornerRadius = UDim.new(0, 8)
    mainCorner.Parent = mainFrame

    local mainStroke = Instance.new("UIStroke")
    mainStroke.Color = Colors.BorderPurple
    mainStroke.Thickness = 1.5
    mainStroke.Parent = mainFrame

    local titleBar = Instance.new("Frame")
    titleBar.Name = "TitleBar"
    titleBar.Size = UDim2.new(1, 0, 0, 38)
    titleBar.BackgroundColor3 = Colors.SidebarBg
    titleBar.BorderSizePixel = 0
    titleBar.Parent = mainFrame

    local titleCorner = Instance.new("UICorner")
    titleCorner.CornerRadius = UDim.new(0, 8)
    titleCorner.Parent = titleBar

    local titleBottomFill = Instance.new("Frame")
    titleBottomFill.Name = "BottomFill"
    titleBottomFill.Size = UDim2.new(1, 0, 0, 10)
    titleBottomFill.Position = UDim2.new(0, 0, 1, -10)
    titleBottomFill.BackgroundColor3 = Colors.SidebarBg
    titleBottomFill.BorderSizePixel = 0
    titleBottomFill.Parent = titleBar

    local titleDiv = Instance.new("Frame")
    titleDiv.Size = UDim2.new(1, 0, 0, 1)
    titleDiv.Position = UDim2.new(0, 0, 1, -1)
    titleDiv.BackgroundColor3 = Colors.Divider
    titleDiv.BorderSizePixel = 0
    titleDiv.Parent = titleBar

    local crescentContainer = Instance.new("Frame")
    crescentContainer.Name = "CrescentIcon"
    crescentContainer.Size = UDim2.new(0, 16, 0, 16)
    crescentContainer.Position = UDim2.new(0, 14, 0.5, -8)
    crescentContainer.BackgroundTransparency = 1
    crescentContainer.ClipsDescendants = true
    crescentContainer.Parent = titleBar

    local crescentOuter = Instance.new("Frame")
    crescentOuter.Name = "Outer"
    crescentOuter.Size = UDim2.new(0, 16, 0, 16)
    crescentOuter.BackgroundColor3 = Colors.PurpleAccent
    crescentOuter.BorderSizePixel = 0
    crescentOuter.Parent = crescentContainer

    local crescentOuterCorner = Instance.new("UICorner")
    crescentOuterCorner.CornerRadius = UDim.new(1, 0)
    crescentOuterCorner.Parent = crescentOuter

    local crescentCutout = Instance.new("Frame")
    crescentCutout.Name = "Cutout"
    crescentCutout.Size = UDim2.new(0, 13, 0, 13)
    crescentCutout.Position = UDim2.new(0, 4, 0, -2)
    crescentCutout.BackgroundColor3 = Colors.SidebarBg
    crescentCutout.BorderSizePixel = 0
    crescentCutout.Parent = crescentOuter

    local crescentCutoutCorner = Instance.new("UICorner")
    crescentCutoutCorner.CornerRadius = UDim.new(1, 0)
    crescentCutoutCorner.Parent = crescentCutout

    local brandTitle = Instance.new("TextLabel")
    brandTitle.Name = "BrandTitle"
    brandTitle.Size = UDim2.new(0, 150, 1, 0)
    brandTitle.Position = UDim2.new(0, 36, 0, 0)
    brandTitle.BackgroundTransparency = 1
    brandTitle.Font = Enum.Font.GothamBold
    brandTitle.Text = "IDENTICAL"
    brandTitle.TextColor3 = Colors.PurplePrimary
    brandTitle.TextSize = 14
    brandTitle.TextXAlignment = Enum.TextXAlignment.Left
    brandTitle.Parent = titleBar

    local gameSubtitle = Instance.new("TextLabel")
    gameSubtitle.Name = "GameSubtitle"
    gameSubtitle.Size = UDim2.new(0, 180, 1, 0)
    gameSubtitle.Position = UDim2.new(0, 118, 0, 0)
    gameSubtitle.BackgroundTransparency = 1
    gameSubtitle.Font = Enum.Font.Gotham
    gameSubtitle.Text = "MURDER MYSTERY 2"
    gameSubtitle.TextColor3 = Colors.PurpleMuted
    gameSubtitle.TextSize = 10
    gameSubtitle.TextXAlignment = Enum.TextXAlignment.Left
    gameSubtitle.Parent = titleBar

    local winControls = Instance.new("Frame")
    winControls.Name = "WindowControls"
    winControls.Size = UDim2.new(0, 60, 1, 0)
    winControls.Position = UDim2.new(1, -66, 0, 0)
    winControls.BackgroundTransparency = 1
    winControls.Parent = titleBar

    local minBtn = Instance.new("TextButton")
    minBtn.Name = "Minimize"
    minBtn.Size = UDim2.new(0, 24, 0, 24)
    minBtn.Position = UDim2.new(0, 0, 0.5, -12)
    minBtn.BackgroundColor3 = Colors.ControlBg
    minBtn.Font = Enum.Font.GothamBold
    minBtn.Text = "[-]"
    minBtn.TextColor3 = Colors.TextMuted
    minBtn.TextSize = 11
    minBtn.BorderSizePixel = 0
    minBtn.Parent = winControls

    local minCorner = Instance.new("UICorner")
    minCorner.CornerRadius = UDim.new(0, 4)
    minCorner.Parent = minBtn

    local closeBtn = Instance.new("TextButton")
    closeBtn.Name = "Close"
    closeBtn.Size = UDim2.new(0, 24, 0, 24)
    closeBtn.Position = UDim2.new(0, 32, 0.5, -12)
    closeBtn.BackgroundColor3 = Colors.ControlBg
    closeBtn.Font = Enum.Font.GothamBold
    closeBtn.Text = "[X]"
    closeBtn.TextColor3 = Colors.AccentRed
    closeBtn.TextSize = 11
    closeBtn.BorderSizePixel = 0
    closeBtn.Parent = winControls

    local closeCorner = Instance.new("UICorner")
    closeCorner.CornerRadius = UDim.new(0, 4)
    closeCorner.Parent = closeBtn

    local dragging = false
    local dragInput, dragStart, startPos

    titleBar.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
            dragStart = input.Position
            startPos = mainFrame.Position
            input.Changed:Connect(function()
                if input.UserInputState == Enum.UserInputState.End then
                    dragging = false
                end
            end)
        end
    end)

    titleBar.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseMovement then
            dragInput = input
        end
    end)

    UserInputService.InputChanged:Connect(function(input)
        if input == dragInput and dragging then
            local delta = input.Position - dragStart
            mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
        end
    end)

    local bodyFrame = Instance.new("Frame")
    bodyFrame.Name = "Body"
    bodyFrame.Size = UDim2.new(1, 0, 1, -62)
    bodyFrame.Position = UDim2.new(0, 0, 0, 38)
    bodyFrame.BackgroundTransparency = 1
    bodyFrame.Parent = mainFrame

    local sidebar = Instance.new("Frame")
    sidebar.Name = "Sidebar"
    sidebar.Size = UDim2.new(0, 140, 1, 0)
    sidebar.BackgroundColor3 = Colors.SidebarBg
    sidebar.BorderSizePixel = 0
    sidebar.Parent = bodyFrame

    local sidebarDiv = Instance.new("Frame")
    sidebarDiv.Size = UDim2.new(0, 1, 1, 0)
    sidebarDiv.Position = UDim2.new(1, -1, 0, 0)
    sidebarDiv.BackgroundColor3 = Colors.Divider
    sidebarDiv.BorderSizePixel = 0
    sidebarDiv.Parent = sidebar

    local searchContainer = Instance.new("Frame")
    searchContainer.Size = UDim2.new(1, -16, 0, 28)
    searchContainer.Position = UDim2.new(0, 8, 0, 8)
    searchContainer.BackgroundColor3 = Colors.ControlBg
    searchContainer.BorderSizePixel = 0
    searchContainer.Parent = sidebar

    local scCorner = Instance.new("UICorner")
    scCorner.CornerRadius = UDim.new(0, 4)
    scCorner.Parent = searchContainer

    local scStroke = Instance.new("UIStroke")
    scStroke.Color = Colors.Divider
    scStroke.Thickness = 1
    scStroke.Parent = searchContainer

    local searchBox = Instance.new("TextBox")
    searchBox.Size = UDim2.new(1, -10, 1, 0)
    searchBox.Position = UDim2.new(0, 6, 0, 0)
    searchBox.BackgroundTransparency = 1
    searchBox.Font = Enum.Font.Gotham
    searchBox.PlaceholderText = "Search..."
    searchBox.PlaceholderColor3 = Colors.TextSubtle
    searchBox.Text = ""
    searchBox.TextColor3 = Colors.TextPrimary
    searchBox.TextSize = 11
    searchBox.TextXAlignment = Enum.TextXAlignment.Left
    searchBox.ClearTextOnFocus = false
    searchBox.Parent = searchContainer

    local navList = Instance.new("ScrollingFrame")
    navList.Name = "NavList"
    navList.Size = UDim2.new(1, -8, 1, -44)
    navList.Position = UDim2.new(0, 4, 0, 40)
    navList.BackgroundTransparency = 1
    navList.ScrollBarThickness = 0
    navList.CanvasSize = UDim2.new(0, 0, 0, 360)
    navList.Parent = sidebar

    local navLayout = Instance.new("UIListLayout")
    navLayout.SortOrder = Enum.SortOrder.LayoutOrder
    navLayout.Padding = UDim.new(0, 2)
    navLayout.Parent = navList

    local contentArea = Instance.new("Frame")
    contentArea.Name = "ContentArea"
    contentArea.Size = UDim2.new(1, -140, 1, 0)
    contentArea.Position = UDim2.new(0, 140, 0, 0)
    contentArea.BackgroundTransparency = 1
    contentArea.Parent = bodyFrame

    local tabFrames = {}
    local navButtons = {}
    local currentTab = "Home"

    local tabNames = {"Home", "Combat", "Visuals", "Farm", "Survival", "Teleports", "Trolling", "Misc"}

    local function createTabContent(name)
        local scroll = Instance.new("ScrollingFrame")
        scroll.Name = "Tab_" .. name
        scroll.Size = UDim2.new(1, -16, 1, -12)
        scroll.Position = UDim2.new(0, 8, 0, 6)
        scroll.BackgroundTransparency = 1
        scroll.BorderSizePixel = 0
        scroll.ScrollBarThickness = 3
        scroll.ScrollBarImageColor3 = Colors.PurpleDark
        scroll.CanvasSize = UDim2.new(0, 0, 0, 0)
        scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
        scroll.Visible = false
        scroll.Parent = contentArea

        local layout = Instance.new("UIListLayout")
        layout.SortOrder = Enum.SortOrder.LayoutOrder
        layout.Padding = UDim.new(0, 8)
        layout.Parent = scroll

        local pad = Instance.new("UIPadding")
        pad.PaddingTop = UDim.new(0, 4)
        pad.PaddingBottom = UDim.new(0, 8)
        pad.PaddingLeft = UDim.new(0, 4)
        pad.PaddingRight = UDim.new(0, 8)
        pad.Parent = scroll

        return scroll
    end

    local function switchTab(name)
        currentTab = name
        for tabName, frame in pairs(tabFrames) do
            frame.Visible = (tabName == name)
        end
        for tabName, btn in pairs(navButtons) do
            local isCurrent = (tabName == name)
            local indicator = btn:FindFirstChild("Indicator")
            if indicator then indicator.Visible = isCurrent end
            btn.BackgroundColor3 = isCurrent and Colors.ControlBg or Colors.SidebarBg
            btn.TextColor3 = isCurrent and Colors.PurplePrimary or Colors.TextMuted
        end
    end

    for idx, name in ipairs(tabNames) do
        local tabScroll = createTabContent(name)
        tabFrames[name] = tabScroll

        local btn = Instance.new("TextButton")
        btn.Name = "Nav_" .. name
        btn.Size = UDim2.new(1, 0, 0, 30)
        btn.BackgroundColor3 = Colors.SidebarBg
        btn.BorderSizePixel = 0
        btn.Font = Enum.Font.GothamBold
        btn.Text = "  " .. name
        btn.TextColor3 = Colors.TextMuted
        btn.TextSize = 12
        btn.TextXAlignment = Enum.TextXAlignment.Left
        btn.LayoutOrder = idx
        btn.Parent = navList

        local bCorner = Instance.new("UICorner")
        bCorner.CornerRadius = UDim.new(0, 5)
        bCorner.Parent = btn

        local ind = Instance.new("Frame")
        ind.Name = "Indicator"
        ind.Size = UDim2.new(0, 3, 0, 16)
        ind.Position = UDim2.new(0, 2, 0.5, -8)
        ind.BackgroundColor3 = Colors.PurpleAccent
        ind.BorderSizePixel = 0
        ind.Visible = false
        ind.Parent = btn

        local indCorner = Instance.new("UICorner")
        indCorner.CornerRadius = UDim.new(0, 2)
        indCorner.Parent = ind

        btn.MouseEnter:Connect(function()
            if currentTab ~= name then
                TweenService:Create(btn, TweenInfo.new(0.12), {BackgroundColor3 = Colors.ControlBg, TextColor3 = Colors.TextPrimary}):Play()
            end
        end)

        btn.MouseLeave:Connect(function()
            if currentTab ~= name then
                TweenService:Create(btn, TweenInfo.new(0.12), {BackgroundColor3 = Colors.SidebarBg, TextColor3 = Colors.TextMuted}):Play()
            end
        end)

        btn.MouseButton1Click:Connect(function()
            switchTab(name)
        end)

        navButtons[name] = btn
    end

    local footerBar = Instance.new("Frame")
    footerBar.Name = "FooterBar"
    footerBar.Size = UDim2.new(1, 0, 0, 24)
    footerBar.Position = UDim2.new(0, 0, 1, -24)
    footerBar.BackgroundColor3 = Colors.SidebarBg
    footerBar.BorderSizePixel = 0
    footerBar.Parent = mainFrame

    local footerCorner = Instance.new("UICorner")
    footerCorner.CornerRadius = UDim.new(0, 8)
    footerCorner.Parent = footerBar

    local footerTopFill = Instance.new("Frame")
    footerTopFill.Name = "TopFill"
    footerTopFill.Size = UDim2.new(1, 0, 0, 10)
    footerTopFill.Position = UDim2.new(0, 0, 0, 0)
    footerTopFill.BackgroundColor3 = Colors.SidebarBg
    footerTopFill.BorderSizePixel = 0
    footerTopFill.Parent = footerBar

    local footerDiv = Instance.new("Frame")
    footerDiv.Size = UDim2.new(1, 0, 0, 1)
    footerDiv.BackgroundColor3 = Colors.Divider
    footerDiv.BorderSizePixel = 0
    footerDiv.Parent = footerBar

    local footerBrand = Instance.new("TextLabel")
    footerBrand.Size = UDim2.new(0, 220, 1, 0)
    footerBrand.Position = UDim2.new(0, 12, 0, 0)
    footerBrand.BackgroundTransparency = 1
    footerBrand.Font = Enum.Font.Gotham
    footerBrand.Text = "Identical v1.0 - Murder Mystery 2"
    footerBrand.TextColor3 = Colors.TextMuted
    footerBrand.TextSize = 10
    footerBrand.TextXAlignment = Enum.TextXAlignment.Left
    footerBrand.Parent = footerBar

    local footerKey = Instance.new("TextLabel")
    footerKey.Size = UDim2.new(0, 200, 1, 0)
    footerKey.Position = UDim2.new(1, -212, 0, 0)
    footerKey.BackgroundTransparency = 1
    footerKey.Font = Enum.Font.Gotham
    footerKey.Text = "[L-CTRL] Menu | [END] Stop All"
    footerKey.TextColor3 = Colors.TextMuted
    footerKey.TextSize = 10
    footerKey.TextXAlignment = Enum.TextXAlignment.Right
    footerKey.Parent = footerBar

    local rowSearchIndex = {}

    local function createCategoryHeader(parent, text)
        local hdr = Instance.new("Frame")
        hdr.Size = UDim2.new(1, 0, 0, 22)
        hdr.BackgroundTransparency = 1
        hdr.Parent = parent

        local lbl = Instance.new("TextLabel")
        lbl.Size = UDim2.new(1, 0, 1, 0)
        lbl.BackgroundTransparency = 1
        lbl.Font = Enum.Font.GothamBold
        lbl.Text = string.upper(text)
        lbl.TextColor3 = Colors.PurplePrimary
        lbl.TextSize = 11
        lbl.TextXAlignment = Enum.TextXAlignment.Left
        lbl.Parent = hdr

        return hdr
    end

    local function createCardGroup(parent)
        local card = Instance.new("Frame")
        card.Size = UDim2.new(1, 0, 0, 0)
        card.AutomaticSize = Enum.AutomaticSize.Y
        card.BackgroundColor3 = Colors.CardBg
        card.BorderSizePixel = 0
        card.Parent = parent

        local cCorner = Instance.new("UICorner")
        cCorner.CornerRadius = UDim.new(0, 6)
        cCorner.Parent = card

        local cStroke = Instance.new("UIStroke")
        cStroke.Color = Colors.Divider
        cStroke.Thickness = 1
        cStroke.Parent = card

        local cLayout = Instance.new("UIListLayout")
        cLayout.SortOrder = Enum.SortOrder.LayoutOrder
        cLayout.Padding = UDim.new(0, 0)
        cLayout.Parent = card

        return card
    end

    local function createToggleRow(parent, labelText, descText, defaultState, callback, registerSearch)
        local row = Instance.new("Frame")
        row.Size = UDim2.new(1, 0, 0, 44)
        row.BackgroundTransparency = 1
        row.BorderSizePixel = 0
        row.Parent = parent

        local infoContainer = Instance.new("Frame")
        infoContainer.Size = UDim2.new(1, -56, 1, 0)
        infoContainer.Position = UDim2.new(0, 12, 0, 0)
        infoContainer.BackgroundTransparency = 1
        infoContainer.Parent = row

        local titleLbl = Instance.new("TextLabel")
        titleLbl.Size = UDim2.new(1, 0, 0, 18)
        titleLbl.Position = UDim2.new(0, 0, 0, 6)
        titleLbl.BackgroundTransparency = 1
        titleLbl.Font = Enum.Font.GothamBold
        titleLbl.Text = labelText
        titleLbl.TextColor3 = Colors.TextPrimary
        titleLbl.TextSize = 12
        titleLbl.TextXAlignment = Enum.TextXAlignment.Left
        titleLbl.Parent = infoContainer

        local descLbl = Instance.new("TextLabel")
        descLbl.Size = UDim2.new(1, 0, 0, 14)
        descLbl.Position = UDim2.new(0, 0, 0, 24)
        descLbl.BackgroundTransparency = 1
        descLbl.Font = Enum.Font.Gotham
        descLbl.Text = descText
        descLbl.TextColor3 = Colors.TextSubtle
        descLbl.TextSize = 10
        descLbl.TextXAlignment = Enum.TextXAlignment.Left
        descLbl.Parent = infoContainer

        local toggleTrack = Instance.new("TextButton")
        toggleTrack.Size = UDim2.new(0, 36, 0, 18)
        toggleTrack.Position = UDim2.new(1, -48, 0.5, -9)
        toggleTrack.BackgroundColor3 = defaultState and Colors.PurpleAccent or Colors.ControlBg
        toggleTrack.BorderSizePixel = 0
        toggleTrack.Text = ""
        toggleTrack.AutoButtonColor = false
        toggleTrack.Parent = row

        local ttCorner = Instance.new("UICorner")
        ttCorner.CornerRadius = UDim.new(1, 0)
        ttCorner.Parent = toggleTrack

        local knob = Instance.new("Frame")
        knob.Size = UDim2.new(0, 14, 0, 14)
        knob.Position = defaultState and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)
        knob.BackgroundColor3 = Colors.TextPrimary
        knob.BorderSizePixel = 0
        knob.Parent = toggleTrack

        local kCorner = Instance.new("UICorner")
        kCorner.CornerRadius = UDim.new(1, 0)
        kCorner.Parent = knob

        local div = Instance.new("Frame")
        div.Size = UDim2.new(1, -24, 0, 1)
        div.Position = UDim2.new(0, 12, 1, -1)
        div.BackgroundColor3 = Colors.Divider
        div.BorderSizePixel = 0
        div.Parent = row

        local state = defaultState
        local function SetState(newState)
            state = newState
            TweenService:Create(toggleTrack, TweenInfo.new(0.18, Enum.EasingStyle.Quad), {
                BackgroundColor3 = state and Colors.PurpleAccent or Colors.ControlBg
            }):Play()
            TweenService:Create(knob, TweenInfo.new(0.18, Enum.EasingStyle.Quad), {
                Position = state and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)
            }):Play()
            if callback then callback(state) end
            if not isSyncingUI and AutoSaveConfig then AutoSaveConfig() end
        end

        toggleTrack.MouseButton1Click:Connect(function()
            SetState(not state)
        end)

        if registerSearch then
            table.insert(rowSearchIndex, {frame = row, query = string.lower(labelText .. " " .. descText)})
        end

        return {Row = row, SetState = SetState, GetState = function() return state end}
    end

    local function createSliderRow(parent, labelText, descText, minVal, maxVal, defaultVal, isFloat, unit, callback, registerSearch)
        local row = Instance.new("Frame")
        row.Size = UDim2.new(1, 0, 0, 48)
        row.BackgroundTransparency = 1
        row.BorderSizePixel = 0
        row.Parent = parent

        local infoContainer = Instance.new("Frame")
        infoContainer.Size = UDim2.new(0.55, 0, 1, 0)
        infoContainer.Position = UDim2.new(0, 12, 0, 0)
        infoContainer.BackgroundTransparency = 1
        infoContainer.Parent = row

        local titleLbl = Instance.new("TextLabel")
        titleLbl.Size = UDim2.new(1, 0, 0, 18)
        titleLbl.Position = UDim2.new(0, 0, 0, 8)
        titleLbl.BackgroundTransparency = 1
        titleLbl.Font = Enum.Font.GothamBold
        titleLbl.Text = labelText
        titleLbl.TextColor3 = Colors.TextPrimary
        titleLbl.TextSize = 12
        titleLbl.TextXAlignment = Enum.TextXAlignment.Left
        titleLbl.Parent = infoContainer

        local descLbl = Instance.new("TextLabel")
        descLbl.Size = UDim2.new(1, 0, 0, 14)
        descLbl.Position = UDim2.new(0, 0, 0, 26)
        descLbl.BackgroundTransparency = 1
        descLbl.Font = Enum.Font.Gotham
        descLbl.Text = descText
        descLbl.TextColor3 = Colors.TextSubtle
        descLbl.TextSize = 10
        descLbl.TextXAlignment = Enum.TextXAlignment.Left
        descLbl.Parent = infoContainer

        local sliderContainer = Instance.new("Frame")
        sliderContainer.Size = UDim2.new(0.4, 0, 1, 0)
        sliderContainer.Position = UDim2.new(0.58, 0, 0, 0)
        sliderContainer.BackgroundTransparency = 1
        sliderContainer.Parent = row

        local valLbl = Instance.new("TextLabel")
        valLbl.Size = UDim2.new(1, -12, 0, 16)
        valLbl.Position = UDim2.new(0, 0, 0, 8)
        valLbl.BackgroundTransparency = 1
        valLbl.Font = Enum.Font.GothamBold
        valLbl.Text = tostring(defaultVal) .. (unit or "")
        valLbl.TextColor3 = Colors.PurplePrimary
        valLbl.TextSize = 11
        valLbl.TextXAlignment = Enum.TextXAlignment.Right
        valLbl.Parent = sliderContainer

        local track = Instance.new("Frame")
        track.Size = UDim2.new(1, -12, 0, 6)
        track.Position = UDim2.new(0, 0, 0, 28)
        track.BackgroundColor3 = Colors.ControlBg
        track.BorderSizePixel = 0
        track.Parent = sliderContainer

        local tCorner = Instance.new("UICorner")
        tCorner.CornerRadius = UDim.new(1, 0)
        tCorner.Parent = track

        local pct = math.clamp((defaultVal - minVal) / (maxVal - minVal), 0, 1)

        local fill = Instance.new("Frame")
        fill.Size = UDim2.new(pct, 0, 1, 0)
        fill.BackgroundColor3 = Colors.PurpleAccent
        fill.BorderSizePixel = 0
        fill.Parent = track

        local fCorner = Instance.new("UICorner")
        fCorner.CornerRadius = UDim.new(1, 0)
        fCorner.Parent = fill

        local div = Instance.new("Frame")
        div.Size = UDim2.new(1, -24, 0, 1)
        div.Position = UDim2.new(0, 12, 1, -1)
        div.BackgroundColor3 = Colors.Divider
        div.BorderSizePixel = 0
        div.Parent = row

        local curVal = defaultVal
        local sliding = false

        local function updateValueFromX(x)
            local rel = math.clamp((x - track.AbsolutePosition.X) / track.AbsoluteSize.X, 0, 1)
            fill.Size = UDim2.new(rel, 0, 1, 0)
            local raw = minVal + rel * (maxVal - minVal)
            curVal = isFloat and math.floor(raw * 100) / 100 or math.floor(raw + 0.5)
            valLbl.Text = tostring(curVal) .. (unit or "")
            if callback then callback(curVal) end
            if not isSyncingUI and AutoSaveConfig then AutoSaveConfig() end
        end

        track.InputBegan:Connect(function(input)
            if input.UserInputType == Enum.UserInputType.MouseButton1 then
                sliding = true
                updateValueFromX(input.Position.X)
            end
        end)

        UserInputService.InputEnded:Connect(function(input)
            if input.UserInputType == Enum.UserInputType.MouseButton1 then
                sliding = false
            end
        end)

        UserInputService.InputChanged:Connect(function(input)
            if sliding and input.UserInputType == Enum.UserInputType.MouseMovement then
                updateValueFromX(input.Position.X)
            end
        end)

        local function SetValue(v)
            curVal = math.clamp(v, minVal, maxVal)
            local r = (curVal - minVal) / (maxVal - minVal)
            fill.Size = UDim2.new(r, 0, 1, 0)
            valLbl.Text = tostring(curVal) .. (unit or "")
            if callback then callback(curVal) end
        end

        if registerSearch then
            table.insert(rowSearchIndex, {frame = row, query = string.lower(labelText .. " " .. descText)})
        end

        return {Row = row, SetValue = SetValue, GetValue = function() return curVal end}
    end

    local function createDropdownRow(parent, labelText, descText, options, defaultOption, callback, registerSearch)
        local row = Instance.new("Frame")
        row.Size = UDim2.new(1, 0, 0, 48)
        row.BackgroundTransparency = 1
        row.BorderSizePixel = 0
        row.Parent = parent

        local infoContainer = Instance.new("Frame")
        infoContainer.Size = UDim2.new(0.55, 0, 1, 0)
        infoContainer.Position = UDim2.new(0, 12, 0, 0)
        infoContainer.BackgroundTransparency = 1
        infoContainer.Parent = row

        local titleLbl = Instance.new("TextLabel")
        titleLbl.Size = UDim2.new(1, 0, 0, 18)
        titleLbl.Position = UDim2.new(0, 0, 0, 8)
        titleLbl.BackgroundTransparency = 1
        titleLbl.Font = Enum.Font.GothamBold
        titleLbl.Text = labelText
        titleLbl.TextColor3 = Colors.TextPrimary
        titleLbl.TextSize = 12
        titleLbl.TextXAlignment = Enum.TextXAlignment.Left
        titleLbl.Parent = infoContainer

        local descLbl = Instance.new("TextLabel")
        descLbl.Size = UDim2.new(1, 0, 0, 14)
        descLbl.Position = UDim2.new(0, 0, 0, 26)
        descLbl.BackgroundTransparency = 1
        descLbl.Font = Enum.Font.Gotham
        descLbl.Text = descText
        descLbl.TextColor3 = Colors.TextSubtle
        descLbl.TextSize = 10
        descLbl.TextXAlignment = Enum.TextXAlignment.Left
        descLbl.Parent = infoContainer

        local dropBtn = Instance.new("TextButton")
        dropBtn.Size = UDim2.new(0, 120, 0, 24)
        dropBtn.Position = UDim2.new(1, -132, 0.5, -12)
        dropBtn.BackgroundColor3 = Colors.ControlBg
        dropBtn.BorderSizePixel = 0
        dropBtn.Font = Enum.Font.GothamBold
        dropBtn.Text = tostring(defaultOption) .. " v"
        dropBtn.TextColor3 = Colors.PurplePrimary
        dropBtn.TextSize = 11
        dropBtn.Parent = row

        local dCorner = Instance.new("UICorner")
        dCorner.CornerRadius = UDim.new(0, 4)
        dCorner.Parent = dropBtn

        local dStroke = Instance.new("UIStroke")
        dStroke.Color = Colors.Divider
        dStroke.Thickness = 1
        dStroke.Parent = dropBtn

        local div = Instance.new("Frame")
        div.Size = UDim2.new(1, -24, 0, 1)
        div.Position = UDim2.new(0, 12, 1, -1)
        div.BackgroundColor3 = Colors.Divider
        div.BorderSizePixel = 0
        div.Parent = row

        local selected = defaultOption
        local optIndex = 1
        for i, opt in ipairs(options) do
            if opt == defaultOption then
                optIndex = i
                break
            end
        end

        dropBtn.MouseButton1Click:Connect(function()
            optIndex = optIndex + 1
            if optIndex > #options then optIndex = 1 end
            selected = options[optIndex]
            dropBtn.Text = tostring(selected) .. " v"
            if callback then callback(selected) end
            if not isSyncingUI and AutoSaveConfig then AutoSaveConfig() end
        end)

        local function SetSelected(opt)
            selected = opt
            for i, o in ipairs(options) do
                if o == opt then
                    optIndex = i
                    break
                end
            end
            dropBtn.Text = tostring(selected) .. " v"
            if callback then callback(selected) end
        end

        local function UpdateOptions(newOptions)
            options = newOptions
            optIndex = 1
            if #options > 0 then
                selected = options[1]
                dropBtn.Text = tostring(selected) .. " v"
            end
        end

        if registerSearch then
            table.insert(rowSearchIndex, {frame = row, query = string.lower(labelText .. " " .. descText)})
        end

        return {Row = row, SetSelected = SetSelected, UpdateOptions = UpdateOptions, GetSelected = function() return selected end}
    end

    local function createButtonRow(parent, labelText, btnText, descText, callback, registerSearch)
        local row = Instance.new("Frame")
        row.Size = UDim2.new(1, 0, 0, 44)
        row.BackgroundTransparency = 1
        row.BorderSizePixel = 0
        row.Parent = parent

        local infoContainer = Instance.new("Frame")
        infoContainer.Size = UDim2.new(1, -120, 1, 0)
        infoContainer.Position = UDim2.new(0, 12, 0, 0)
        infoContainer.BackgroundTransparency = 1
        infoContainer.Parent = row

        local titleLbl = Instance.new("TextLabel")
        titleLbl.Size = UDim2.new(1, 0, 0, 18)
        titleLbl.Position = UDim2.new(0, 0, 0, 6)
        titleLbl.BackgroundTransparency = 1
        titleLbl.Font = Enum.Font.GothamBold
        titleLbl.Text = labelText
        titleLbl.TextColor3 = Colors.TextPrimary
        titleLbl.TextSize = 12
        titleLbl.TextXAlignment = Enum.TextXAlignment.Left
        titleLbl.Parent = infoContainer

        local descLbl = Instance.new("TextLabel")
        descLbl.Size = UDim2.new(1, 0, 0, 14)
        descLbl.Position = UDim2.new(0, 0, 0, 24)
        descLbl.BackgroundTransparency = 1
        descLbl.Font = Enum.Font.Gotham
        descLbl.Text = descText
        descLbl.TextColor3 = Colors.TextSubtle
        descLbl.TextSize = 10
        descLbl.TextXAlignment = Enum.TextXAlignment.Left
        descLbl.Parent = infoContainer

        local btn = Instance.new("TextButton")
        btn.Size = UDim2.new(0, 96, 0, 24)
        btn.Position = UDim2.new(1, -108, 0.5, -12)
        btn.BackgroundColor3 = Colors.PurpleDark
        btn.BorderSizePixel = 0
        btn.Font = Enum.Font.GothamBold
        btn.Text = btnText
        btn.TextColor3 = Colors.PurplePrimary
        btn.TextSize = 11
        btn.Parent = row

        local bCorner = Instance.new("UICorner")
        bCorner.CornerRadius = UDim.new(0, 4)
        bCorner.Parent = btn

        local bStroke = Instance.new("UIStroke")
        bStroke.Color = Colors.PurpleAccent
        bStroke.Thickness = 1
        bStroke.Parent = btn

        local div = Instance.new("Frame")
        div.Size = UDim2.new(1, -24, 0, 1)
        div.Position = UDim2.new(0, 12, 1, -1)
        div.BackgroundColor3 = Colors.Divider
        div.BorderSizePixel = 0
        div.Parent = row

        btn.MouseEnter:Connect(function()
            TweenService:Create(btn, TweenInfo.new(0.12), {BackgroundColor3 = Colors.PurpleGlow, TextColor3 = Colors.TextPrimary}):Play()
        end)
        btn.MouseLeave:Connect(function()
            TweenService:Create(btn, TweenInfo.new(0.12), {BackgroundColor3 = Colors.PurpleDark, TextColor3 = Colors.PurplePrimary}):Play()
        end)

        btn.MouseButton1Click:Connect(callback)

        if registerSearch then
            table.insert(rowSearchIndex, {frame = row, query = string.lower(labelText .. " " .. descText)})
        end

        return row
    end

    local function createInfoRow(parent, labelText, valueText, registerSearch)
        local row = Instance.new("Frame")
        row.Size = UDim2.new(1, 0, 0, 36)
        row.BackgroundTransparency = 1
        row.BorderSizePixel = 0
        row.Parent = parent

        local titleLbl = Instance.new("TextLabel")
        titleLbl.Size = UDim2.new(0.45, 0, 1, 0)
        titleLbl.Position = UDim2.new(0, 12, 0, 0)
        titleLbl.BackgroundTransparency = 1
        titleLbl.Font = Enum.Font.GothamBold
        titleLbl.Text = labelText
        titleLbl.TextColor3 = Colors.TextPrimary
        titleLbl.TextSize = 11
        titleLbl.TextXAlignment = Enum.TextXAlignment.Left
        titleLbl.Parent = row

        local valLbl = Instance.new("TextLabel")
        valLbl.Size = UDim2.new(0.5, 0, 1, 0)
        valLbl.Position = UDim2.new(0.5, -12, 0, 0)
        valLbl.BackgroundTransparency = 1
        valLbl.Font = Enum.Font.Gotham
        valLbl.Text = valueText
        valLbl.TextColor3 = Colors.PurplePrimary
        valLbl.TextSize = 11
        valLbl.TextXAlignment = Enum.TextXAlignment.Right
        valLbl.Parent = row

        local div = Instance.new("Frame")
        div.Size = UDim2.new(1, -24, 0, 1)
        div.Position = UDim2.new(0, 12, 1, -1)
        div.BackgroundColor3 = Colors.Divider
        div.BorderSizePixel = 0
        div.Parent = row

        if registerSearch then
            table.insert(rowSearchIndex, {frame = row, query = string.lower(labelText)})
        end

        return {
            Row = row,
            SetValue = function(newVal) valLbl.Text = tostring(newVal) end,
            SetColor = function(newCol) valLbl.TextColor3 = newCol end
        }
    end

    createCategoryHeader(tabFrames.Home, "Round Status & Roles")
    local homeRoundCard = createCardGroup(tabFrames.Home)
    local statusRoundRow = createInfoRow(homeRoundCard, "Round State", "Waiting...", true)
    local timerRoundRow = createInfoRow(homeRoundCard, "Time Remaining", "0:00", true)
    local murdererRow = createInfoRow(homeRoundCard, "Murderer", "Undetected", true)
    local sheriffRow = createInfoRow(homeRoundCard, "Sheriff", "Undetected", true)
    murdererRow.SetColor(Colors.AccentRed)
    sheriffRow.SetColor(Colors.AccentBlue)

    createCategoryHeader(tabFrames.Home, "Quick Actions")
    local homeActionCard = createCardGroup(tabFrames.Home)

    createButtonRow(homeActionCard, "Shoot Murderer", "SHOOT", "Instantly equips gun and shoots murderer", function()
        local murderer = nil
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Murderer" then
                murderer = p
                break
            end
        end

        local char = LocalPlayer.Character
        local bp = LocalPlayer:FindFirstChild("Backpack")
        local gun = (bp and bp:FindFirstChild("Gun")) or (char and char:FindFirstChild("Gun"))
        if not gun then
            SendNotification("Identical", "You do not have the Gun!", 2)
            return
        end
        if not murderer or not murderer.Character then
            SendNotification("Identical", "Murderer not found or deceased!", 2)
            return
        end

        local hum = getHumanoid(char)
        if hum and bp and gun.Parent == bp then
            hum:EquipTool(gun)
            task.wait(0.1)
        end

        local root = getRootPart(char)
        local mRoot = getRootPart(murderer.Character)
        if root and mRoot and gun:FindFirstChild("Shoot") then
            local rayAtt = root:FindFirstChild("GunRaycastAttachment")
            local origin = rayAtt and rayAtt.WorldCFrame or root.CFrame
            local targetCF = CFrame.new(mRoot.Position)
            gun.Shoot:FireServer(origin, targetCF)
            SendNotification("Identical", "Shot fired at Murderer (" .. murderer.Name .. ")!", 2)
        end
    end, true)

    createButtonRow(homeActionCard, "Grab Gun", "GRAB", "Teleports to dropped gun or picks it up", function()
        local drop = getGunDrop()
        local gunPart = getGunDropPart(drop)
        local char = LocalPlayer.Character
        local root = getRootPart(char)
        if not gunPart then
            SendNotification("Identical", "No Gun is currently dropped on map!", 2)
            return
        end
        if root then
            root.CFrame = gunPart.CFrame * CFrame.new(0, 1.5, 0)
            task.wait(0.05)
            interactWithGunDrop(gunPart, drop)
            SendNotification("Identical", "Grabbed dropped gun!", 2)
        end
    end, true)

    createButtonRow(homeActionCard, "Announce Roles", "CHAT", "Announces Murderer & Sheriff in public chat", function()
        local murderer, sheriff = getRolePlayers()
        local msg = "[Identical] "
        if murderer then
            msg = msg .. "Murderer: " .. murderer.Name .. " | "
        else
            msg = msg .. "Murderer: Unknown | "
        end
        if sheriff then
            msg = msg .. "Sheriff: " .. sheriff.Name
        else
            msg = msg .. "Sheriff: Unknown"
        end

        local textChannels = TextChatService:FindFirstChild("TextChannels")
        local rbxGeneral = textChannels and textChannels:FindFirstChild("RBXGeneral")
        if rbxGeneral and rbxGeneral.SendAsync then
            rbxGeneral:SendAsync(msg)
        else
            pcall(function()
                local events = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
                local sayReq = events and events:FindFirstChild("SayMessageRequest")
                if sayReq then
                    sayReq:FireServer(msg, "All")
                end
            end)
        end
        SendNotification("Identical", "Roles announced in chat!", 2)
    end, true)

    createButtonRow(homeActionCard, "Copy Death List", "COPY", "Copies deceased players this round to clipboard", function()
        if #deadPlayersList == 0 then
            SendNotification("Identical", "No recorded deaths yet this round.", 2)
            return
        end
        local text = "MM2 Dead Players: " .. table.concat(deadPlayersList, ", ")
        if setclipboard then
            setclipboard(text)
            SendNotification("Identical", "Death list copied to clipboard!", 2)
        else
            SendNotification("Identical", "Clipboard API not supported.", 2)
        end
    end, true)

    createCategoryHeader(tabFrames.Home, "Configuration Profile")
    local cfgCard = createCardGroup(tabFrames.Home)

    createButtonRow(cfgCard, "Save Configuration", "SAVE", "Writes all current settings to disk", function()
        AutoSaveConfig()
        SendNotification("Identical", "Configuration profile saved to disk!", 2)
    end, true)

    createButtonRow(cfgCard, "Reload Configuration", "LOAD", "Restores saved settings profile from disk", function()
        if LoadSavedConfig() then
            if SyncUIWithConfig then SyncUIWithConfig() end
            SendNotification("Identical", "Configuration profile restored!", 2)
        else
            SendNotification("Identical", "No saved profile found.", 2)
        end
    end, true)

    createButtonRow(cfgCard, "Reset Defaults", "RESET", "Restores all settings to default values", function()
        for k, v in pairs(DefaultConfig) do
            Config[k] = v
        end
        if SyncUIWithConfig then SyncUIWithConfig() end
        AutoSaveConfig()
        SendNotification("Identical", "Settings reset to defaults!", 2)
    end, true)

    createCategoryHeader(tabFrames.Combat, "Sheriff & Gun")
    local gunCard = createCardGroup(tabFrames.Combat)

    ctrls.AutoShoot = createToggleRow(gunCard, "Auto Shoot Murderer", "Automatically fires revolver at Murderer in sight", Config.AutoShoot, function(v)
        Config.AutoShoot = v
    end, true)

    ctrls.SilentAim = createToggleRow(gunCard, "Silent Aim", "Redirects shot raycast directly to target hitbox", Config.SilentAim, function(v)
        Config.SilentAim = v
    end, true)

    ctrls.AimPrediction = createToggleRow(gunCard, "Aim Prediction", "Compensates for target velocity & movement", Config.AimPrediction, function(v)
        Config.AimPrediction = v
    end, true)

    ctrls.PingComp = createToggleRow(gunCard, "Ping Compensation", "Adjusts bullet lead time according to player ping", Config.PingComp, function(v)
        Config.PingComp = v
    end, true)

    ctrls.SingleShot = createToggleRow(gunCard, "Single Shot Lock", "Fires one verified shot and halts until next reset", Config.SingleShot, function(v)
        Config.SingleShot = v
    end, true)

    ctrls.AutoEquipGun = createToggleRow(gunCard, "Auto Equip Gun", "Pulls out revolver when Murderer is within range", Config.AutoEquipGun, function(v)
        Config.AutoEquipGun = v
    end, true)

    ctrls.GrabGunAuto = createToggleRow(gunCard, "Full Gun Grabber", "Automatically collects dropped gun immediately", Config.GrabGunAuto, function(v)
        Config.GrabGunAuto = v
    end, true)

    ctrls.ShowFOV = createToggleRow(gunCard, "Show FOV Circle", "Draws FOV circle on screen for aimbot", Config.ShowFOV, function(v)
        Config.ShowFOV = v
    end, true)

    ctrls.FOVRadius = createSliderRow(gunCard, "FOV Radius", "Radius of aimbot lock target field", 50, 700, Config.FOVRadius, false, " px", function(v)
        Config.FOVRadius = v
    end, true)

    createCategoryHeader(tabFrames.Combat, "Murderer & Knife")
    local knifeCard = createCardGroup(tabFrames.Combat)

    ctrls.KillAura = createToggleRow(knifeCard, "Kill Aura", "Automatically strikes any player inside aura reach", Config.KillAura, function(v)
        Config.KillAura = v
    end, true)

    ctrls.AutoKill = createToggleRow(knifeCard, "Auto Kill Innocents", "Constantly eliminates innocents with knife", Config.AutoKill, function(v)
        Config.AutoKill = v
    end, true)

    ctrls.KillMode = createDropdownRow(knifeCard, "Kill Mode", "Method used for knife strikes", {"Legit", "Blatant", "Throw"}, Config.KillMode, function(v)
        Config.KillMode = v
    end, true)

    ctrls.KnifeSilentAim = createToggleRow(knifeCard, "Knife Silent Aim", "Redirects thrown knives directly into target players", Config.KnifeSilentAim, function(v)
        Config.KnifeSilentAim = v
    end, true)

    ctrls.KillAll = createToggleRow(knifeCard, "Kill All (No Limit)", "Eliminates all remaining living players instantly", Config.KillAll, function(v)
        Config.KillAll = v
    end, true)

    ctrls.AuraRange = createSliderRow(knifeCard, "Aura Range", "Distance threshold for melee knife strikes", 5, 45, Config.AuraRange, false, " studs", function(v)
        Config.AuraRange = v
    end, true)

    ctrls.ShowAuraRing = createToggleRow(knifeCard, "Show Aura Ring", "Draws visual indicator ring around character", Config.ShowAuraRing, function(v)
        Config.ShowAuraRing = v
    end, true)

    ctrls.AutoEquipKnife = createToggleRow(knifeCard, "Auto Equip Knife", "Equips knife automatically when targets in range", Config.AutoEquipKnife, function(v)
        Config.AutoEquipKnife = v
    end, true)

    ctrls.ProximityKnife = createToggleRow(knifeCard, "Proximity Knife", "Pre-emptively draws blade when enemy nears", Config.ProximityKnife, function(v)
        Config.ProximityKnife = v
    end, true)

    createCategoryHeader(tabFrames.Combat, "Hitbox Expansion & Stalker")
    local hitboxCard = createCardGroup(tabFrames.Combat)

    ctrls.HitboxExpander = createToggleRow(hitboxCard, "Hitbox Expander", "Expands player root hitboxes for easy stabs/shots", Config.HitboxExpander, function(v)
        Config.HitboxExpander = v
        if not v then
            for part, sz in pairs(originalHitboxSizes) do
                if part and part.Parent then
                    part.Size = sz
                    part.Transparency = 1
                end
            end
            originalHitboxSizes = {}
        end
    end, true)

    ctrls.HitboxSize = createSliderRow(hitboxCard, "Hitbox Size", "Expanded size multiplier for hitboxes", 4, 30, Config.HitboxSize, false, " studs", function(v)
        Config.HitboxSize = v
    end, true)

    ctrls.FollowMurderer = createToggleRow(hitboxCard, "Murderer Follow", "Maintains safe following position behind Murderer", Config.FollowMurderer, function(v)
        Config.FollowMurderer = v
    end, true)

    ctrls.FollowDist = createSliderRow(hitboxCard, "Follow Offset", "Distance maintained while following Murderer", 8, 40, Config.FollowDist, false, " studs", function(v)
        Config.FollowDist = v
    end, true)

    createCategoryHeader(tabFrames.Visuals, "Full Role ESP")
    local espRoleCard = createCardGroup(tabFrames.Visuals)

    ctrls.RoleESP = createToggleRow(espRoleCard, "Role ESP Enabled", "Master toggle for character role highlights", Config.RoleESP, function(v)
        Config.RoleESP = v
        if not v then clearESPCategory("mm2_") end
    end, true)

    ctrls.ESPChams = createToggleRow(espRoleCard, "Chams (3D Highlight)", "Renders solid 3D glowing color chams", Config.ESPChams, function(v)
        Config.ESPChams = v
        if not v then clearESPCategory("cham_") end
    end, true)

    ctrls.ESPBoxes = createToggleRow(espRoleCard, "Player Boxes", "Draws bounding box around target players", Config.ESPBoxes, function(v)
        Config.ESPBoxes = v
    end, true)

    ctrls.ESPNames = createToggleRow(espRoleCard, "Role Tags & Names", "Displays overhead role tags and player names", Config.ESPNames, function(v)
        Config.ESPNames = v
    end, true)

    ctrls.ESPDistance = createToggleRow(espRoleCard, "Distance Labels", "Displays distance in studs to each player", Config.ESPDistance, function(v)
        Config.ESPDistance = v
    end, true)

    ctrls.ESPTracers = createToggleRow(espRoleCard, "Snapline Tracers", "Draws tracers from under character to targets", Config.ESPTracers, function(v)
        Config.ESPTracers = v
        if not v then
            for _, line in pairs(trackedTracers) do
                if line then line.Visible = false end
            end
        end
    end, true)

    ctrls.ESPDistanceMax = createSliderRow(espRoleCard, "Max ESP Distance", "Maximum render distance for highlights", 50, 1000, Config.ESPDistanceMax, false, " studs", function(v)
        Config.ESPDistanceMax = v
    end, true)

    createCategoryHeader(tabFrames.Visuals, "Item & World Highlights")
    local espItemCard = createCardGroup(tabFrames.Visuals)

    ctrls.GunESP = createToggleRow(espItemCard, "Dropped Gun ESP", "Highlights dropped revolver when Sheriff falls", Config.GunESP, function(v)
        Config.GunESP = v
        if not v then clearESPCategory("gun_") end
    end, true)

    ctrls.CoinESP = createToggleRow(espItemCard, "Coin ESP", "Highlights active coin spawns across map", Config.CoinESP, function(v)
        Config.CoinESP = v
        if not v then clearESPCategory("coin_") end
    end, true)

    createCategoryHeader(tabFrames.Farm, "Coin Farming")
    local farmCard = createCardGroup(tabFrames.Farm)

    ctrls.CoinFarm = createToggleRow(farmCard, "Auto Farm Coins", "Automatically collects all active coins on map", Config.CoinFarm, function(v)
        Config.CoinFarm = v
    end, true)

    ctrls.FarmMethod = createDropdownRow(farmCard, "Movement Method", "Navigation method to reach coin positions", {"Glide", "Tween", "Walk"}, Config.FarmMethod, function(v)
        Config.FarmMethod = v
    end, true)

    ctrls.FarmSpeed = createSliderRow(farmCard, "Farm Speed", "Movement speed while farming coins", 16, 60, Config.FarmSpeed, false, " studs/s", function(v)
        Config.FarmSpeed = v
    end, true)

    ctrls.SafeCoinFarm = createToggleRow(farmCard, "Safe Farming", "Avoids coins within Murderer danger radius", Config.SafeCoinFarm, function(v)
        Config.SafeCoinFarm = v
    end, true)

    ctrls.BagFullStop = createToggleRow(farmCard, "Bag Full Stop", "Halts farming once 40-coin bag limit is met", Config.BagFullStop, function(v)
        Config.BagFullStop = v
    end, true)

    ctrls.QuickFarm = createToggleRow(farmCard, "Quick Mode", "High velocity rapid coin sweep", Config.QuickFarm, function(v)
        Config.QuickFarm = v
    end, true)

    createCategoryHeader(tabFrames.Survival, "Murderer Avoidance & Auto-Play")
    local survCard = createCardGroup(tabFrames.Survival)

    ctrls.MurdererAvoid = createToggleRow(survCard, "Murderer Avoidance", "Automatically maneuvers away from active Murderer", Config.MurdererAvoid, function(v)
        Config.MurdererAvoid = v
    end, true)

    ctrls.SafetyRadius = createSliderRow(survCard, "Safety Radius", "Minimum distance maintained from Murderer", 20, 80, Config.SafetyRadius, false, " studs", function(v)
        Config.SafetyRadius = v
    end, true)

    ctrls.RetreatToLobby = createToggleRow(survCard, "Retreat to Lobby", "Teleports to lobby if Murderer gets too close", Config.RetreatToLobby, function(v)
        Config.RetreatToLobby = v
    end, true)

    ctrls.ProximityAlert = createToggleRow(survCard, "Proximity Alert", "Warns on screen when Murderer approaches", Config.ProximityAlert, function(v)
        Config.ProximityAlert = v
    end, true)

    ctrls.SprintWhenChased = createToggleRow(survCard, "Sprint When Chased", "Increases walk speed when Murderer is near", Config.SprintWhenChased, function(v)
        Config.SprintWhenChased = v
    end, true)

    ctrls.AutoPlay = createToggleRow(survCard, "Role-Based Auto Play", "Automates actions according to assigned role", Config.AutoPlay, function(v)
        Config.AutoPlay = v
    end, true)

    createCategoryHeader(tabFrames.Teleports, "Map & Role Navigation")
    local tpCard = createCardGroup(tabFrames.Teleports)

    createButtonRow(tpCard, "Teleport to Murderer", "GOTO", "Teleports behind the active Murderer", function()
        local murderer = nil
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Murderer" then
                murderer = p
                break
            end
        end
        local root = getRootPart(LocalPlayer.Character)
        if murderer and murderer.Character and root then
            local mRoot = getRootPart(murderer.Character)
            if mRoot then
                root.CFrame = mRoot.CFrame * CFrame.new(0, 0, 4)
                SendNotification("Identical", "Teleported to Murderer (" .. murderer.Name .. ")", 2)
            end
        else
            SendNotification("Identical", "Murderer not found or deceased.", 2)
        end
    end, true)

    createButtonRow(tpCard, "Teleport to Sheriff", "GOTO", "Teleports next to the active Sheriff", function()
        local sheriff = nil
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Sheriff" then
                sheriff = p
                break
            end
        end
        local root = getRootPart(LocalPlayer.Character)
        if sheriff and sheriff.Character and root then
            local sRoot = getRootPart(sheriff.Character)
            if sRoot then
                root.CFrame = sRoot.CFrame * CFrame.new(0, 0, 4)
                SendNotification("Identical", "Teleported to Sheriff (" .. sheriff.Name .. ")", 2)
            end
        else
            SendNotification("Identical", "Sheriff not found or deceased.", 2)
        end
    end, true)

    createButtonRow(tpCard, "Teleport to Active Map", "GOTO", "Teleports to match map spawns", function()
        local map = getActiveMap()
        local root = getRootPart(LocalPlayer.Character)
        if map and root then
            local spawns = map:FindFirstChild("Spawns")
            if spawns and #spawns:GetChildren() > 0 then
                local sp = spawns:GetChildren()[1]
                root.CFrame = sp.CFrame * CFrame.new(0, 3, 0)
            else
                local p = map:FindFirstChildWhichIsA("BasePart")
                if p then root.CFrame = p.CFrame * CFrame.new(0, 5, 0) end
            end
            SendNotification("Identical", "Teleported to " .. map.Name, 2)
        else
            SendNotification("Identical", "No active map currently found.", 2)
        end
    end, true)

    createButtonRow(tpCard, "Teleport to Lobby", "GOTO", "Teleports into the lobby safe area", function()
        local lobby = getLobbyModel()
        local root = getRootPart(LocalPlayer.Character)
        if lobby and root then
            local p = lobby:FindFirstChild("Spawns") or lobby:FindFirstChildWhichIsA("BasePart")
            if p then
                local targetPart = p:IsA("Model") and p:GetChildren()[1] or p
                if targetPart then root.CFrame = targetPart.CFrame * CFrame.new(0, 3, 0) end
            end
            SendNotification("Identical", "Teleported to Lobby", 2)
        end
    end, true)

    ctrls.AutoDrop = createToggleRow(tpCard, "Auto Drop at Round Start", "Drops into map immediately when round starts", Config.AutoDrop, function(v)
        Config.AutoDrop = v
    end, true)

    createCategoryHeader(tabFrames.Teleports, "Saved Coordinates")
    local saveCard = createCardGroup(tabFrames.Teleports)

    createButtonRow(saveCard, "Save Location 1", "SAVE 1", "Stores current position in Slot 1", function()
        local root = getRootPart(LocalPlayer.Character)
        if root then
            Config.SaveSlot1 = root.CFrame
            AutoSaveConfig()
            SendNotification("Identical", "Saved Slot 1 position to disk.", 2)
        end
    end, true)

    createButtonRow(saveCard, "Teleport Location 1", "GOTO 1", "Teleports back to Slot 1 position", function()
        local root = getRootPart(LocalPlayer.Character)
        if root and Config.SaveSlot1 then
            root.CFrame = Config.SaveSlot1
            SendNotification("Identical", "Teleported to Slot 1.", 2)
        else
            SendNotification("Identical", "No location saved in Slot 1.", 2)
        end
    end, true)

    createButtonRow(saveCard, "Save Location 2", "SAVE 2", "Stores current position in Slot 2", function()
        local root = getRootPart(LocalPlayer.Character)
        if root then
            Config.SaveSlot2 = root.CFrame
            AutoSaveConfig()
            SendNotification("Identical", "Saved Slot 2 position to disk.", 2)
        end
    end, true)

    createButtonRow(saveCard, "Teleport Location 2", "GOTO 2", "Teleports back to Slot 2 position", function()
        local root = getRootPart(LocalPlayer.Character)
        if root and Config.SaveSlot2 then
            root.CFrame = Config.SaveSlot2
            SendNotification("Identical", "Teleported to Slot 2.", 2)
        else
            SendNotification("Identical", "No location saved in Slot 2.", 2)
        end
    end, true)

    createCategoryHeader(tabFrames.Trolling, "Fling")
    local flingCard = createCardGroup(tabFrames.Trolling)

    local function flingCharacter(targetChar)
        if isFlinging then return end
        local char = LocalPlayer.Character
        local root = getRootPart(char)
        local tRoot = getRootPart(targetChar)
        if not root or not tRoot then return end

        local hum = getHumanoid(char)
        local tHum = getHumanoid(targetChar)
        if not hum or hum.Health <= 0 or not tHum or tHum.Health <= 0 then return end

        isFlinging = true
        local oldCF = root.CFrame

        if sethiddenproperty then
            pcall(sethiddenproperty, LocalPlayer, "SimulationRadius", 10000)
            pcall(sethiddenproperty, LocalPlayer, "MaxSimulationRadius", 10000)
        end
        if setsimulationradius then
            pcall(setsimulationradius, 10000)
        end

        for _, obj in ipairs(root:GetChildren()) do
            if obj:IsA("BodyMover") then
                pcall(function() obj:Destroy() end)
            end
        end

        local bAV = Instance.new("BodyAngularVelocity")
        bAV.Name = "FlingTorque"
        bAV.AngularVelocity = Vector3.new(0, 9e9, 0)
        bAV.MaxTorque = Vector3.new(0, 9e9, 0)
        bAV.P = 9e9
        bAV.Parent = root

        local bV = Instance.new("BodyVelocity")
        bV.Name = "FlingVelocity"
        bV.Velocity = Vector3.new(0, 0, 0)
        bV.MaxForce = Vector3.new(9e9, 9e9, 9e9)
        bV.Parent = root

        local steppedConn = RunService.Stepped:Connect(function()
            if not char or not root or not root.Parent then return end
            for _, child in ipairs(char:GetDescendants()) do
                if child:IsA("BasePart") then
                    child.CanCollide = false
                end
            end
        end)

        local startTime = tick()
        local duration = 1.5

        while tick() - startTime < duration do
            if not targetChar or not targetChar.Parent or not tRoot or not tRoot.Parent or tHum.Health <= 0 then
                break
            end
            if not char or not char.Parent or not root or not root.Parent or hum.Health <= 0 then
                break
            end

            local style = Config.FlingStyle
            if style == "Velocity" then
                root.CFrame = CFrame.new(tRoot.Position + Vector3.new(0, 1.2, 0))
                root.AssemblyLinearVelocity = Vector3.new(0, 9e9, 0)
                root.AssemblyAngularVelocity = Vector3.new(9e9, 9e9, 9e9)
            elseif style == "Orbit" then
                local angle = (tick() - startTime) * 20
                local off = Vector3.new(math.cos(angle) * 1.5, 0.5, math.sin(angle) * 1.5)
                root.CFrame = CFrame.new(tRoot.Position + off, tRoot.Position)
                root.AssemblyLinearVelocity = Vector3.new(9e9, 9e9, 9e9)
                root.AssemblyAngularVelocity = Vector3.new(9e9, 9e9, 9e9)
            else
                root.CFrame = tRoot.CFrame
                root.AssemblyLinearVelocity = Vector3.new(9e9, 9e9, 9e9)
                root.AssemblyAngularVelocity = Vector3.new(9e9, 9e9, 9e9)
            end

            RunService.Heartbeat:Wait()
        end

        pcall(function() steppedConn:Disconnect() end)
        pcall(function() bAV:Destroy() end)
        pcall(function() bV:Destroy() end)

        if root and root.Parent then
            root.AssemblyLinearVelocity = Vector3.zero
            root.AssemblyAngularVelocity = Vector3.zero
            root.CFrame = oldCF
        end

        task.wait(0.15)
        isFlinging = false
    end

    createButtonRow(flingCard, "Fling Murderer", "FLING", "Flings the Murderer across the map", function()
        local murderer = nil
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Murderer" then
                murderer = p
                break
            end
        end
        if murderer and murderer.Character then
            SendNotification("Identical", "Flinging Murderer (" .. murderer.Name .. ")...", 2)
            task.spawn(flingCharacter, murderer.Character)
        else
            SendNotification("Identical", "Murderer not found or dead.", 2)
        end
    end, true)

    createButtonRow(flingCard, "Fling Sheriff", "FLING", "Flings the Sheriff across the map", function()
        local sheriff = nil
        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Sheriff" then
                sheriff = p
                break
            end
        end
        if sheriff and sheriff.Character then
            SendNotification("Identical", "Flinging Sheriff (" .. sheriff.Name .. ")...", 2)
            task.spawn(flingCharacter, sheriff.Character)
        else
            SendNotification("Identical", "Sheriff not found or dead.", 2)
        end
    end, true)

    ctrls.FlingStyle = createDropdownRow(flingCard, "Fling Style", "Physics technique for flinging targets", {"Torque", "Velocity", "Orbit"}, Config.FlingStyle, function(v)
        Config.FlingStyle = v
    end, true)



    createCategoryHeader(tabFrames.Misc, "Movement & Character")
    local moveCard = createCardGroup(tabFrames.Misc)

    ctrls.SpeedEnabled = createToggleRow(moveCard, "Speed Boost", "Increases player movement speed", Config.SpeedEnabled, function(v)
        Config.SpeedEnabled = v
    end, true)

    ctrls.SpeedValue = createSliderRow(moveCard, "Walk Speed", "Speed value when boost is enabled", 16, 60, Config.SpeedValue, false, "", function(v)
        Config.SpeedValue = v
    end, true)

    ctrls.JumpEnabled = createToggleRow(moveCard, "Safe Jump Boost", "Increases jump power safely", Config.JumpEnabled, function(v)
        Config.JumpEnabled = v
    end, true)

    ctrls.JumpValue = createSliderRow(moveCard, "Jump Power", "Jump power value", 50, 100, Config.JumpValue, false, "", function(v)
        Config.JumpValue = v
    end, true)

    ctrls.InfiniteJump = createToggleRow(moveCard, "Infinite Jump", "Jump continuously mid-air", Config.InfiniteJump, function(v)
        Config.InfiniteJump = v
    end, true)

    ctrls.Noclip = createToggleRow(moveCard, "Noclip", "Walk freely through walls and doors", Config.Noclip, function(v)
        Config.Noclip = v
    end, true)

    createCategoryHeader(tabFrames.Misc, "Environment & Safety")
    local envCard = createCardGroup(tabFrames.Misc)

    ctrls.Fullbright = createToggleRow(envCard, "Fullbright", "Eliminates darkness and shadows", Config.Fullbright, function(v)
        Config.Fullbright = v
        if not v then
            Lighting.Ambient = Color3.fromRGB(128, 128, 128)
            Lighting.Brightness = 1
        end
    end, true)

    ctrls.NoFog = createToggleRow(envCard, "Remove Fog", "Clears distance atmosphere fog", Config.NoFog, function(v)
        Config.NoFog = v
        if not v then Lighting.FogEnd = 1000 end
    end, true)

    ctrls.DisableParticles = createToggleRow(envCard, "Disable Particles (Anti-Lag)", "Improves FPS by disabling particle emitters", Config.DisableParticles, function(v)
        Config.DisableParticles = v
    end, true)

    ctrls.AntiFling = createToggleRow(envCard, "Anti-Fling", "Blocks other players from colliding & flinging you", Config.AntiFling, function(v)
        Config.AntiFling = v
    end, true)

    ctrls.AntiVoid = createToggleRow(envCard, "Anti-Void", "Dynamic floor recovery when flung or falling", Config.AntiVoid, function(v)
        Config.AntiVoid = v
    end, true)

    ctrls.AntiAFK = createToggleRow(envCard, "Anti-AFK", "Prevents Roblox 20-minute idle disconnect", Config.AntiAFK, function(v)
        Config.AntiAFK = v
    end, true)

    createButtonRow(envCard, "Reset Character", "RESET", "Safely respawns your character", function()
        local hum = getHumanoid(LocalPlayer.Character)
        if hum then hum.Health = 0 end
    end, true)

    createCategoryHeader(tabFrames.Misc, "Server Tools")
    local srvCard = createCardGroup(tabFrames.Misc)

    local function queueReinject()
        local qot = (syn and syn.queue_on_teleport) or queue_on_teleport or queueonteleport or (fluxus and fluxus.queue_on_teleport)
        if qot then
            local code = [[
                task.spawn(function()
                    repeat task.wait(0.5) until game:IsLoaded() and game:GetService("Players").LocalPlayer
                    task.wait(1)
                    if isfile and isfile("Identical_MM2.lua") then
                        loadstring(readfile("Identical_MM2.lua"))()
                    elseif isfile and isfile("scripts/mm2.luau") then
                        loadstring(readfile("scripts/mm2.luau"))()
                    elseif isfile and isfile("Identical.lua") then
                        loadstring(readfile("Identical.lua"))()
                    end
                end)
            ]]
            pcall(qot, code)
        end
    end

    createButtonRow(srvCard, "Rejoin Server", "REJOIN", "Rejoins the current MM2 server", function()
        queueReinject()
        SendNotification("Identical", "Rejoining server...", 2)
        task.wait(0.1)
        pcall(function()
            TeleportService:TeleportToPlaceInstance(game.PlaceId, game.JobId, LocalPlayer)
        end)
    end, true)

    createButtonRow(srvCard, "Server Hop (Random)", "HOP", "Finds and joins a populated public server", function()
        queueReinject()
        SendNotification("Identical", "Searching for active server...", 2)
        local url = "https://games.roblox.com/v1/games/" .. tostring(game.PlaceId) .. "/servers/Public?sortOrder=Desc&excludeFullGames=true&limit=100"
        local ok, res = pcall(function() return game:HttpGet(url) end)
        if ok and res then
            local data = nil
            pcall(function() data = HttpService:JSONDecode(res) end)
            if data and data.data then
                local validServers = {}
                for _, s in ipairs(data.data) do
                    if s.id ~= game.JobId and type(s.playing) == "number" and type(s.maxPlayers) == "number" and s.playing >= 5 and s.playing < s.maxPlayers then
                        table.insert(validServers, s)
                    end
                end
                if #validServers == 0 then
                    for _, s in ipairs(data.data) do
                        if s.id ~= game.JobId and type(s.playing) == "number" and type(s.maxPlayers) == "number" and s.playing >= 2 and s.playing < s.maxPlayers then
                            table.insert(validServers, s)
                        end
                    end
                end
                if #validServers > 0 then
                    local chosen = validServers[math.random(1, #validServers)]
                    SendNotification("Identical", "Teleporting (" .. chosen.playing .. "/" .. chosen.maxPlayers .. ")...", 3)
                    task.wait(0.1)
                    pcall(function()
                        TeleportService:TeleportToPlaceInstance(game.PlaceId, chosen.id, LocalPlayer)
                    end)
                    return
                end
            end
        end
        SendNotification("Identical", "No alternative servers found.", 2)
    end, true)

    createButtonRow(srvCard, "Server Hop (Low Player)", "LOW POP", "Joins a low player count server for farming", function()
        queueReinject()
        SendNotification("Identical", "Searching for low-pop server...", 2)
        local url = "https://games.roblox.com/v1/games/" .. tostring(game.PlaceId) .. "/servers/Public?sortOrder=Asc&limit=100"
        local ok, res = pcall(function() return game:HttpGet(url) end)
        if ok and res then
            local data = nil
            pcall(function() data = HttpService:JSONDecode(res) end)
            if data and data.data then
                local candidates = {}
                for _, s in ipairs(data.data) do
                    if s.id ~= game.JobId and type(s.playing) == "number" and type(s.maxPlayers) == "number" and s.playing >= 2 and s.playing <= 5 then
                        table.insert(candidates, s)
                    end
                end
                if #candidates == 0 then
                    for _, s in ipairs(data.data) do
                        if s.id ~= game.JobId and type(s.playing) == "number" and type(s.maxPlayers) == "number" and s.playing >= 2 and s.playing < s.maxPlayers then
                            table.insert(candidates, s)
                        end
                    end
                end
                if #candidates > 0 then
                    local chosen = candidates[1]
                    SendNotification("Identical", "Joining low-pop (" .. chosen.playing .. "/" .. chosen.maxPlayers .. ")...", 3)
                    task.wait(0.1)
                    pcall(function()
                        TeleportService:TeleportToPlaceInstance(game.PlaceId, chosen.id, LocalPlayer)
                    end)
                    return
                end
            end
        end
        SendNotification("Identical", "No low-population servers found.", 2)
    end, true)

    createButtonRow(srvCard, "Unload Identical", "UNLOAD", "Closes UI and cleans all hooks & ESP", function()
        if getgenv().IdenticalMM2Unload then
            getgenv().IdenticalMM2Unload()
        end
    end, true)

    SyncUIWithConfig = function()
        isSyncingUI = true
        for key, c in pairs(ctrls) do
            if Config[key] ~= nil then
                if c.SetState then
                    c.SetState(Config[key])
                elseif c.SetValue then
                    c.SetValue(Config[key])
                elseif c.SetSelected then
                    c.SetSelected(Config[key])
                end
            end
        end
        isSyncingUI = false
    end

    SyncUIWithConfig()

    switchTab("Home")

    searchBox:GetPropertyChangedSignal("Text"):Connect(function()
        local q = string.lower(searchBox.Text:gsub("^%s*(.-)%s*$", "%1"))
        for _, item in ipairs(rowSearchIndex) do
            item.frame.Visible = (q == "" or string.find(item.query, q, 1, true) ~= nil)
        end
    end)

    ToggleUiVisibility = function()
        uiVisible = not uiVisible
        mainFrame.Visible = uiVisible
        if floatingCrescent then
            floatingCrescent.Visible = not uiVisible
        end
    end

    minBtn.MouseButton1Click:Connect(function()
        isMinimized = not isMinimized
        bodyFrame.Visible = not isMinimized
        footerBar.Visible = not isMinimized
        mainFrame.Size = isMinimized and UDim2.new(0, 690, 0, 38) or UDim2.new(0, 690, 0, 470)
        minBtn.Text = isMinimized and "[+]" or "[-]"
    end)

    closeBtn.MouseButton1Click:Connect(ToggleUiVisibility)

    UserInputService.InputBegan:Connect(function(input, gpe)
        if gpe then return end
        if input.KeyCode == Enum.KeyCode.LeftControl then
            ToggleUiVisibility()
        elseif input.KeyCode == Enum.KeyCode.End then
            Config.KillAura = false
            Config.AutoShoot = false
            Config.CoinFarm = false
            Config.AutoKill = false
            SendNotification("Identical", "EMERGENCY STOP: Features halted.", 2)
        elseif input.KeyCode == Enum.KeyCode.Space and Config.InfiniteJump then
            local hum = getHumanoid(LocalPlayer.Character)
            if hum then hum:ChangeState(Enum.HumanoidStateType.Jumping) end
        end
    end)

    local function getOrCreateESP(id, adornee, text, color)
        local bb = trackedESPElements[id]
        if not bb or not bb.Parent then
            bb = Instance.new("BillboardGui")
            bb.Name = id
            bb.Size = UDim2.new(0, 140, 0, 40)
            bb.StudsOffset = Vector3.new(0, 2.5, 0)
            bb.AlwaysOnTop = true
            bb.MaxDistance = Config.ESPDistanceMax
            bb.Adornee = adornee
            bb.Parent = espFolder

            local tag = Instance.new("TextLabel")
            tag.Name = "Tag"
            tag.Size = UDim2.new(1, 0, 1, 0)
            tag.BackgroundTransparency = 1
            tag.Font = Enum.Font.GothamBold
            tag.TextSize = 11
            tag.TextColor3 = color
            tag.TextStrokeTransparency = 0.3
            tag.TextStrokeColor3 = Color3.new(0, 0, 0)
            tag.Parent = bb

            trackedESPElements[id] = bb
        end
        bb.Adornee = adornee
        bb.MaxDistance = Config.ESPDistanceMax
        local tag = bb:FindFirstChild("Tag")
        if tag then
            tag.Text = text
            tag.TextColor3 = color
        end
        return bb
    end

    local function getOrCreateCham(id, targetChar, color)
        local hl = trackedESPElements["cham_" .. id]
        if not hl or not hl.Parent then
            hl = Instance.new("Highlight")
            hl.Name = "cham_" .. id
            hl.FillColor = color
            hl.OutlineColor = Colors.TextPrimary
            hl.FillTransparency = 0.45
            hl.OutlineTransparency = 0.1
            hl.Adornee = targetChar
            hl.Parent = espFolder
            trackedESPElements["cham_" .. id] = hl
        end
        hl.Adornee = targetChar
        hl.FillColor = color
        return hl
    end

    local function updateTracer(id, targetPos, color)
        if not Drawing or not Drawing.new then return end
        local line = trackedTracers[id]
        if not line then
            pcall(function()
                line = Drawing.new("Line")
                line.Thickness = 1.5
                line.Transparency = 0.8
                line.Color = color
                trackedTracers[id] = line
            end)
            line = trackedTracers[id]
        end
        if not line then return end
        
        if Config.ESPTracers then
            local targetFeet = targetPos - Vector3.new(0, 2.5, 0)
            local screenPos, onScreen = Camera:WorldToViewportPoint(targetFeet)
            if onScreen then
                local localChar = LocalPlayer.Character
                local localRoot = getRootPart(localChar)
                local fromPos = nil
                
                if localRoot then
                    local feetWorldPos = localRoot.Position - Vector3.new(0, 2.8, 0)
                    local myScreenPos, myOnScreen = Camera:WorldToViewportPoint(feetWorldPos)
                    if myOnScreen then
                        fromPos = Vector2.new(myScreenPos.X, myScreenPos.Y)
                    end
                end
                
                if not fromPos then
                    fromPos = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
                end
                
                line.From = fromPos
                line.To = Vector2.new(screenPos.X, screenPos.Y)
                line.Color = color
                line.Visible = true
            else
                line.Visible = false
            end
        else
            line.Visible = false
        end
    end
    
    local function removeTracer(id)
        if trackedTracers[id] then
            pcall(function() trackedTracers[id]:Remove() end)
            trackedTracers[id] = nil
        end
    end

    local function getClosestKnifeTarget()
        local char = LocalPlayer.Character
        local root = getRootPart(char)
        if not root then return nil end

        local mousePos = UserInputService:GetMouseLocation()
        local bestTarget = nil
        local bestDist = math.huge

        for _, p in ipairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and isPlayerAlive(p) and p.Character then
                local tRoot = getRootPart(p.Character)
                if tRoot then
                    local screenPos = Camera:WorldToViewportPoint(tRoot.Position)
                    local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude
                    if (not Config.ShowFOV or dist <= Config.FOVRadius) and dist < bestDist then
                        bestDist = dist
                        bestTarget = p
                    end
                end
            end
        end

        if not bestTarget then
            local minDist = math.huge
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and isPlayerAlive(p) and p.Character then
                    local tRoot = getRootPart(p.Character)
                    if tRoot then
                        local d = (root.Position - tRoot.Position).Magnitude
                        if d < minDist then
                            minDist = d
                            bestTarget = p
                        end
                    end
                end
            end
        end

        return bestTarget
    end

    local silentAimHookActive = true
    if hookmetamethod and getnamecallmethod then
        local oldNamecall
        oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
            local method = getnamecallmethod()

            if silentAimHookActive and not checkcaller() and method == "FireServer" then
                if self.Name == "KnifeThrown" and (Config.KnifeSilentAim or Config.SilentAim) then
                    local args = {...}
                    local target = getClosestKnifeTarget()
                    if target and target.Character then
                        local tRoot = getRootPart(target.Character)
                        if tRoot then
                            local targetPos = tRoot.Position
                            if Config.AimPrediction then
                                local lead = Config.PingComp and 0.16 or 0.12
                                targetPos = targetPos + (tRoot.AssemblyLinearVelocity * lead)
                            end
                            args[2] = CFrame.new(targetPos)
                            if setnamecallmethod then setnamecallmethod("FireServer") end
                            return oldNamecall(self, unpack(args))
                        end
                    end
                elseif self.Name == "Shoot" and Config.SilentAim then
                    local args = {...}
                    local murderer = nil
                    for _, p in ipairs(Players:GetPlayers()) do
                        if p ~= LocalPlayer and isPlayerAlive(p) and getPlayerRole(p) == "Murderer" then
                            murderer = p
                            break
                        end
                    end
                    if murderer and murderer.Character then
                        local mRoot = getRootPart(murderer.Character)
                        if mRoot then
                            local targetPos = mRoot.Position
                            if Config.AimPrediction then
                                local lead = Config.PingComp and 0.16 or 0.12
                                targetPos = targetPos + (mRoot.AssemblyLinearVelocity * lead)
                            end
                            args[2] = CFrame.new(targetPos)
                            if setnamecallmethod then setnamecallmethod("FireServer") end
                            return oldNamecall(self, unpack(args))
                        end
                    end
                end
            end

            if setnamecallmethod then setnamecallmethod(method) end
            return oldNamecall(self, ...)
        end))
    end

    local lastFarmTick = 0
    local lastShootTick = 0
    local lastKnifeTick = 0
    local lastSafePosition = nil
    local roundStartedFlag = false
    local auraRingPart = nil
    local auraRingGui = nil
    local fovCircle = nil

    if Drawing and Drawing.new then
        pcall(function()
            local d = Drawing
            fovCircle = d.new("Circle")
            fovCircle.Thickness = 1.5
            fovCircle.Color = Colors.PurpleAccent
            fovCircle.Filled = false
            fovCircle.Transparency = 0.8
            fovCircle.Visible = false
        end)
    end

    local function updateAuraRing(root)
        if not Config.ShowAuraRing or not root then
            if auraRingPart then
                auraRingPart.Transparency = 1
                if auraRingGui then auraRingGui.Enabled = false end
            end
            return
        end

        local diameter = Config.AuraRange * 2

        if not auraRingPart or not auraRingPart.Parent then
            auraRingPart = Instance.new("Part")
            auraRingPart.Name = "Identical_AuraRing"
            auraRingPart.Size = Vector3.new(diameter, 0.01, diameter)
            auraRingPart.Anchored = true
            auraRingPart.CanCollide = false
            auraRingPart.CastShadow = false
            auraRingPart.Transparency = 1

            auraRingGui = Instance.new("SurfaceGui")
            auraRingGui.Name = "RingGui"
            auraRingGui.Face = Enum.NormalId.Top
            auraRingGui.AlwaysOnTop = true
            auraRingGui.LightInfluence = 0
            auraRingGui.Adornee = auraRingPart
            auraRingGui.Parent = auraRingPart

            local ringFrame = Instance.new("Frame")
            ringFrame.Name = "Circle"
            ringFrame.Size = UDim2.new(1, 0, 1, 0)
            ringFrame.BackgroundColor3 = Colors.PurpleAccent
            ringFrame.BackgroundTransparency = 0.92
            ringFrame.BorderSizePixel = 0
            ringFrame.Parent = auraRingGui

            local corner = Instance.new("UICorner")
            corner.CornerRadius = UDim.new(1, 0)
            corner.Parent = ringFrame

            local stroke = Instance.new("UIStroke")
            stroke.Color = Colors.PurpleAccent
            stroke.Thickness = 2.5
            stroke.Transparency = 0.1
            stroke.Parent = ringFrame

            auraRingPart.Parent = Workspace
        end

        if auraRingGui then auraRingGui.Enabled = true end
        auraRingPart.Size = Vector3.new(diameter, 0.01, diameter)
        auraRingPart.CFrame = CFrame.new(root.Position.X, root.Position.Y - 2.85, root.Position.Z)
    end

    local function updateFOVCircle()
        if not fovCircle then return end
        if Config.ShowFOV then
            fovCircle.Visible = true
            fovCircle.Radius = Config.FOVRadius
            fovCircle.Position = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
        else
            fovCircle.Visible = false
        end
    end

    table.insert(activeConnections, RunService.Stepped:Connect(function()
        if Config.AntiFling and not isFlinging then
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and p.Character then
                    for _, part in ipairs(p.Character:GetChildren()) do
                        if part:IsA("BasePart") and part.CanCollide then
                            part.CanCollide = false
                        end
                    end
                end
            end
        end
    end))

    table.insert(activeConnections, RunService.Heartbeat:Connect(function()
        local char = LocalPlayer.Character
        local root = getRootPart(char)
        local hum = getHumanoid(char)
        local now = tick()

        updateAuraRing(root)
        updateFOVCircle()

        if root and hum then
            local vel = root.AssemblyLinearVelocity
            local angVel = root.AssemblyAngularVelocity
            local velMag = vel.Magnitude
            local angMag = angVel.Magnitude

            if not isFlinging and hum.Health > 0 and hum.FloorMaterial ~= Enum.Material.Air and velMag < 75 and angMag < 35 then
                lastSafePosition = root.CFrame
            end

            if not isFlinging and (Config.AntiFling or Config.AntiVoid) and lastSafePosition then
                if velMag > 120 or angMag > 90 then
                    root.AssemblyLinearVelocity = Vector3.zero
                    root.AssemblyAngularVelocity = Vector3.zero
                    root.CFrame = lastSafePosition
                end

                if Config.AntiVoid and (lastSafePosition.Y - root.Position.Y > 30) then
                    root.AssemblyLinearVelocity = Vector3.zero
                    root.AssemblyAngularVelocity = Vector3.zero
                    root.CFrame = lastSafePosition
                end
            end
        end

        if hum then
            if Config.SpeedEnabled then
                if hum.WalkSpeed ~= Config.SpeedValue then hum.WalkSpeed = Config.SpeedValue end
            else
                if hum.WalkSpeed ~= 16 and not Config.CoinFarm then hum.WalkSpeed = 16 end
            end

            if Config.JumpEnabled then
                if hum.JumpPower ~= Config.JumpValue then hum.JumpPower = Config.JumpValue end
            end
        end

        if Config.Noclip and char then
            for _, p in ipairs(char:GetDescendants()) do
                if p:IsA("BasePart") and p.CanCollide then
                    p.CanCollide = false
                end
            end
        end



        if Config.Fullbright then
            Lighting.Ambient = Color3.new(1, 1, 1)
            Lighting.Brightness = 2
        end

        if Config.NoFog then
            Lighting.FogEnd = 1e6
        end

        local rtp = Workspace:FindFirstChild("RoundTimerPart")
        if rtp and rtp:FindFirstChild("SurfaceGui") then
            local sg = rtp.SurfaceGui
            local cr = sg:FindFirstChild("CurrentRound")
            local tm = sg:FindFirstChild("Timer")
            if cr and tm then
                statusRoundRow.SetValue(cr.Text)
                timerRoundRow.SetValue(tm.Text)
                if cr.Text == "Current Round" and not roundStartedFlag then
                    roundStartedFlag = true
                    if Config.AutoDrop then
                        local map = getActiveMap()
                        if map and root then
                            local p = map:FindFirstChild("Spawns") or map:FindFirstChildWhichIsA("BasePart")
                            if p then
                                local sp = p:IsA("Model") and p:GetChildren()[1] or p
                                if sp then root.CFrame = sp.CFrame * CFrame.new(0, 4, 0) end
                            end
                        end
                    end
                elseif cr.Text ~= "Current Round" then
                    roundStartedFlag = false
                end
            end
        end

        local murderer, sheriff = getRolePlayers()
        murdererRow.SetValue(murderer and (murderer.Name .. (isPlayerAlive(murderer) and "" or " [DEAD]")) or "Undetected")
        sheriffRow.SetValue(sheriff and (sheriff.Name .. (isPlayerAlive(sheriff) and "" or " [DEAD]")) or "Undetected")

        if Config.RoleESP and root then
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and p.Character and isPlayerAlive(p) then
                    local pRoot = getRootPart(p.Character)
                    if pRoot then
                        local dist = math.floor((root.Position - pRoot.Position).Magnitude)
                        if dist <= Config.ESPDistanceMax then
                            local role = getPlayerRole(p)
                            local col = Colors.AccentGreen
                            if role == "Murderer" then
                                col = Colors.AccentRed
                            elseif role == "Sheriff" then
                                col = Colors.AccentBlue
                            end

                            local text = p.Name
                            if Config.ESPNames then
                                text = "[" .. role .. "] " .. p.Name
                            end
                            if Config.ESPDistance then
                                text = text .. " (" .. dist .. "s)"
                            end

                            getOrCreateESP("mm2_" .. p.UserId, pRoot, text, col)
                            if Config.ESPChams then
                                getOrCreateCham(p.UserId, p.Character, col)
                            end
                            updateTracer("mm2_" .. p.UserId, pRoot.Position, col)
                        end
                    end
                else
                    if trackedESPElements["mm2_" .. p.UserId] then
                        trackedESPElements["mm2_" .. p.UserId]:Destroy()
                        trackedESPElements["mm2_" .. p.UserId] = nil
                    end
                    if trackedESPElements["cham_" .. p.UserId] then
                        trackedESPElements["cham_" .. p.UserId]:Destroy()
                        trackedESPElements["cham_" .. p.UserId] = nil
                    end
                    removeTracer("mm2_" .. p.UserId)
                end
            end
        end

        if Config.GunESP and root then
            local drop = getGunDrop()
            local gunPart = getGunDropPart(drop)
            if gunPart then
                local dist = math.floor((root.Position - gunPart.Position).Magnitude)
                if dist <= Config.ESPDistanceMax then
                    getOrCreateESP("gun_drop", gunPart, "[GUN DROP] " .. dist .. "m", Colors.AccentYellow)
                end
            else
                clearESPCategory("gun_")
            end
        end

        if Config.CoinESP and root then
            local coins = getAllActiveCoins()
            for _, coin in ipairs(coins) do
                local dist = math.floor((root.Position - coin.Position).Magnitude)
                if dist <= Config.ESPDistanceMax then
                    getOrCreateESP("coin_" .. coin:GetDebugId(), coin, "Coin", Colors.AccentYellow)
                end
            end
        end

        if Config.GrabGunAuto and root then
            local drop = getGunDrop()
            local gunPart = getGunDropPart(drop)
            if gunPart and (root.Position - gunPart.Position).Magnitude <= Config.GunGrabDist then
                interactWithGunDrop(gunPart, drop)
            end
        end

        if Config.AutoShoot and root and (now - lastShootTick >= 0.5) then
            local bp = LocalPlayer:FindFirstChild("Backpack")
            local gun = (bp and bp:FindFirstChild("Gun")) or (char and char:FindFirstChild("Gun"))
            if gun and murderer and murderer.Character and isPlayerAlive(murderer) then
                local mRoot = getRootPart(murderer.Character)
                if mRoot then
                    if hum and bp and gun.Parent == bp then
                        hum:EquipTool(gun)
                    end
                    local rayAtt = root:FindFirstChild("GunRaycastAttachment")
                    local origin = rayAtt and rayAtt.WorldCFrame or root.CFrame
                    local aimPos = mRoot.Position
                    if Config.AimPrediction then
                        aimPos = aimPos + (mRoot.AssemblyLinearVelocity * 0.12)
                    end
                    if gun:FindFirstChild("Shoot") then
                        gun.Shoot:FireServer(origin, CFrame.new(aimPos))
                        lastShootTick = now
                        if Config.SingleShot then Config.AutoShoot = false end
                    end
                end
            end
        end

        if (Config.KillAura or Config.AutoKill) and root and (now - lastKnifeTick >= 0.2) then
            local bp = LocalPlayer:FindFirstChild("Backpack")
            local knife = (bp and bp:FindFirstChild("Knife")) or (char and char:FindFirstChild("Knife"))
            if knife then
                if hum and bp and knife.Parent == bp then
                    hum:EquipTool(knife)
                end
                local events = knife:FindFirstChild("Events")
                if events then
                    if Config.KillMode == "Throw" and events:FindFirstChild("KnifeThrown") and knife:FindFirstChild("Handle") then
                        local target = getClosestKnifeTarget()
                        if target and target.Character then
                            local tRoot = getRootPart(target.Character)
                            if tRoot then
                                local d = (root.Position - tRoot.Position).Magnitude
                                if Config.KillAll or d <= Config.AuraRange then
                                    local targetPos = tRoot.Position
                                    if Config.AimPrediction then
                                        local lead = Config.PingComp and 0.16 or 0.12
                                        targetPos = targetPos + (tRoot.AssemblyLinearVelocity * lead)
                                    end
                                    events.KnifeThrown:FireServer(knife.Handle.CFrame, CFrame.new(targetPos))
                                    lastKnifeTick = now
                                end
                            end
                        end
                    elseif events:FindFirstChild("HandleTouched") then
                        for _, p in ipairs(Players:GetPlayers()) do
                            if p ~= LocalPlayer and isPlayerAlive(p) then
                                local tRoot = getRootPart(p.Character)
                                if tRoot then
                                    local d = (root.Position - tRoot.Position).Magnitude
                                    if Config.KillAll or d <= Config.AuraRange then
                                        events.HandleTouched:FireServer(tRoot)
                                        if events:FindFirstChild("KnifeStabbed") then
                                            events.KnifeStabbed:FireServer()
                                        end
                                        lastKnifeTick = now
                                        if not Config.KillAll then
                                            break
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end

        if Config.HitboxExpander then
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and p.Character and isPlayerAlive(p) then
                    local hrp = p.Character:FindFirstChild("HumanoidRootPart")
                    if hrp then
                        if not originalHitboxSizes[hrp] then
                            originalHitboxSizes[hrp] = hrp.Size
                        end
                        hrp.Size = Vector3.new(Config.HitboxSize, Config.HitboxSize, Config.HitboxSize)
                        hrp.Transparency = Config.HitboxTransparency
                        hrp.CanCollide = false
                    end
                end
            end
        end

        if Config.MurdererAvoid and root and murderer and murderer.Character and isPlayerAlive(murderer) then
            local mRoot = getRootPart(murderer.Character)
            if mRoot then
                local dist = (root.Position - mRoot.Position).Magnitude
                if dist < Config.SafetyRadius then
                    if Config.SprintWhenChased and hum then
                        hum.WalkSpeed = math.max(hum.WalkSpeed, 26)
                    end
                    if Config.RetreatToLobby then
                        local lobby = getLobbyModel()
                        if lobby then
                            local sp = lobby:FindFirstChildWhichIsA("BasePart")
                            if sp then root.CFrame = sp.CFrame * CFrame.new(0, 3, 0) end
                        end
                    else
                        local awayDir = (root.Position - mRoot.Position).Unit
                        root.CFrame = root.CFrame + Vector3.new(awayDir.X * 0.8, 0, awayDir.Z * 0.8)
                    end
                end
            end
        end

        if Config.FollowMurderer and root and murderer and murderer.Character and isPlayerAlive(murderer) then
            local mRoot = getRootPart(murderer.Character)
            if mRoot then
                local targetPos = mRoot.Position - (mRoot.CFrame.LookVector * Config.FollowDist)
                root.CFrame = root.CFrame:Lerp(CFrame.new(targetPos, mRoot.Position), 0.15)
            end
        end

        if Config.CoinFarm and root and (now - lastFarmTick >= 0.05) then
            if Config.BagFullStop and getCurrentCoinCount() >= Config.CoinBagCap then
                Config.CoinFarm = false
                SendNotification("Identical", "Coin bag limit reached! Farming stopped.", 3)
            else
                local coins = getAllActiveCoins()
                local bestCoin = nil
                local bestDist = 1000

                for _, c in ipairs(coins) do
                    local d = (root.Position - c.Position).Magnitude
                    local isSafe = true
                    if Config.SafeCoinFarm and murderer and murderer.Character and isPlayerAlive(murderer) then
                        local mRoot = getRootPart(murderer.Character)
                        if mRoot and (c.Position - mRoot.Position).Magnitude < Config.SafetyRadius then
                            isSafe = false
                        end
                    end
                    if isSafe and d < bestDist then
                        bestDist = d
                        bestCoin = c
                    end
                end

                if bestCoin then
                    if hum then
                        hum.WalkSpeed = Config.FarmSpeed
                    end
                    local targetPos = bestCoin.Position
                    local dist = (root.Position - targetPos).Magnitude

                    for _, part in ipairs(char:GetChildren()) do
                        if part:IsA("BasePart") then
                            part.CanCollide = false
                        end
                    end

                    local speed = Config.QuickFarm and 38 or math.clamp(Config.FarmSpeed, 16, 42)

                    if Config.FarmMethod == "Tween" then
                        local travelTime = math.max(dist / speed, 0.05)
                        local tweenInfo = TweenInfo.new(travelTime, Enum.EasingStyle.Linear)
                        local tw = TweenService:Create(root, tweenInfo, {CFrame = CFrame.new(targetPos)})
                        tw:Play()
                        if dist < 7 then
                            fireTouch(root, bestCoin)
                            local rHand = char:FindFirstChild("RightHand") or char:FindFirstChild("Right Arm")
                            if rHand then fireTouch(rHand, bestCoin) end
                        end
                    elseif Config.FarmMethod == "Glide" or Config.QuickFarm then
                        local dir = (targetPos - root.Position)
                        if dir.Magnitude > 0.3 then
                            root.AssemblyLinearVelocity = dir.Unit * speed
                        else
                            root.AssemblyLinearVelocity = Vector3.zero
                        end
                        if dist < 7 then
                            fireTouch(root, bestCoin)
                            local rHand = char:FindFirstChild("RightHand") or char:FindFirstChild("Right Arm")
                            if rHand then fireTouch(rHand, bestCoin) end
                        end
                    else
                        if hum then
                            hum:MoveTo(targetPos)
                            if targetPos.Y > root.Position.Y + 2.0 and hum:GetState() ~= Enum.HumanoidStateType.Jumping then
                                hum:ChangeState(Enum.HumanoidStateType.Jumping)
                            end
                        end
                        if dist < 7 then
                            fireTouch(root, bestCoin)
                            local rHand = char:FindFirstChild("RightHand") or char:FindFirstChild("Right Arm")
                            if rHand then fireTouch(rHand, bestCoin) end
                        end
                    end
                    lastFarmTick = now
                end
            end
        end
    end))

    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= LocalPlayer then
            p.CharacterAdded:Connect(function(c)
                local h = c:WaitForChild("Humanoid", 5)
                if h then
                    h.Died:Connect(function()
                        table.insert(deadPlayersList, p.Name)
                        if Config.DeathNotifs then
                            local r = getPlayerRole(p)
                            SendNotification("Death Alert", p.Name .. " [" .. r .. "] has died!", 3)
                        end
                    end)
                end
            end)
        end
    end

    Players.PlayerAdded:Connect(function(p)
        p.CharacterAdded:Connect(function(c)
            local h = c:WaitForChild("Humanoid", 5)
            if h then
                h.Died:Connect(function()
                    table.insert(deadPlayersList, p.Name)
                    if Config.DeathNotifs then
                        local r = getPlayerRole(p)
                        SendNotification("Death Alert", p.Name .. " [" .. r .. "] has died!", 3)
                    end
                end)
            end
        end)
    end)

    LocalPlayer.Idled:Connect(function()
        if Config.AntiAFK then
            local VirtualUser = game:GetService("VirtualUser")
            VirtualUser:CaptureController()
            VirtualUser:ClickButton2(Vector2.new(0, 0))
        end
    end)

    getgenv().IdenticalMM2Unload = function()
        for _, conn in ipairs(activeConnections) do
            pcall(function() conn:Disconnect() end)
        end
        clearESPCategory("")
        for id in pairs(trackedTracers) do
            pcall(function() trackedTracers[id]:Remove() end)
        end
        silentAimHookActive = false
        if auraRingPart then
            auraRingPart:Destroy()
            auraRingPart = nil
        end
        if fovCircle then
            pcall(function() fovCircle:Remove() end)
            fovCircle = nil
        end
        for part, sz in pairs(originalHitboxSizes) do
            if part and part.Parent then
                part.Size = sz
                part.Transparency = 1
            end
        end
        if screenGui then screenGui:Destroy() end
        getgenv().IdenticalMM2Unload = nil
    end

    SendNotification("Identical", "Loaded! Press Left-CTRL to toggle.", 3)
20

Script Of J | Murder-Mystery-2

keyless working mobile Murder-Mystery-2

Player locations through walls - Enabled

loadstring(game:HttpGet("https://pastebin.com/raw/wzVXba05"))()
pastebin.com updated 2 Nov 2026 664 views 6 loader source ↗
21

FoggyHub | 50+ undetected features

key system working 50+ undetected features

functions:https://pastefy.app/1eLdWliW/raw[too big list for description]

loadstring(game:HttpGet("https://www.foggysoftworks.xyz/loader.lua"))()
foggysoftworks.xyz updated 2 Nov 2026 5.3k views 5 loader source ↗
22

MM2 TosanHub Allot of OP features

key system working

This script includes features such as Kill aura kill all and has an aura reach to set you're Aura reach up plus it includes a tab for flinging! And you don't have to search for it anymore A teleport tab to teleport to the game map lobby and the sheriff and murderer awesome esp too you can set it too murder Sherrie and

loadstring(game:HttpGet("https://raw.githubusercontent.com/2desp/TosanStudios/refs/heads/main/MAIN"))()
by Tosan studios raw.githubusercontent.com updated 2 Nov 2026 4.6k views 4 loader source ↗
24

SP Hub - Murder Mystery 2 Script (ESP Players, Tracers & Dropped Guns)

keyless working mobile

Gain a massive advantage in Murder Mystery 2 with SP Hub! This script features essential ESP Toggles including ESP Players, Tracers, and Dropped Guns. You can fully customize who to target (Innocent, Sheriff, Hero, Murderer) and track the round timer.

loadstring(game:HttpGet("https://raw.githubusercontent.com/as6cd0/SP_Hub/refs/heads/main/Loader"))()
by SP Hub raw.githubusercontent.com updated 2 Nov 2026 549 views 2 loader source ↗
25

Cps Network | MM2 Auto Farm, Esp, Silent aim

keyless working mobile MM2 Auto FarmEspSilent aim

high mentained script for murder mystery 2 it has many features for innoncent or sherif or murderer. such as silent aim aimbot esp speed fly auto farming coins and much more avaliable

loadstring(game:HttpGet("https://gist.githubusercontent.com/aquzeh/3c69588c2625ea157a75857eecc16095/raw/murder-mystery"))()
gist.githubusercontent.com updated 2 Nov 2026 388 views 2 loader source ↗
26

Snowy Hub | Auto Grab Gun, Teleport, NoClip & MORE

key system working mobile Auto Grab GunTeleportNoClip & MORE

Copy Murderer Name: Instantly copies the current murderer's username.Kill Aura (as Murderer): Automatically eliminates nearby players while you're the murderer.Auto-Kill Murderer (as Sheriff): Automatically targets and shoots the murderer when possible.Grab Dropped Gun: Instantly picks up the sheriff's dropped gun.Auto

loadstring(game:HttpGet("https://flowauth.net/v1/ui/a87f00d9adf63658655fcd02ab86a4ef.lua"))()
flowauth.net updated 2 Nov 2026 312 views 2 loader source ↗
27

Vertex Hub - Perfect for candy and coins auto farming

keyless working mobile

Vertex hub is the perfect script if u want an all in one instead of finding 10 different scripts for fling all maybe,get vertex hub for mm2

loadstring(game:HttpGet('https://raw.smokingscripts.org/vertex.lua'))()
by Vertex raw.smokingscripts.org updated 2 Nov 2026 297 views 2 loader source ↗
28

Murder mistery script by cursed guy

keyless working

Fling 3 options murder,sheriff,innocent

-- ========================================================
by Cursed guy inline updated 2 Nov 2026 121 views 2
full source (19884 chars)
-- ========================================================
--  MURDER MYSTERY 2 - MM2 MENU BY CURSED GUY (SMOOTH FARM -20%)
-- ========================================================

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local CoreGui = game:GetService("CoreGui")
local Workspace = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer

-- Cleanup previous GUI
if CoreGui:FindFirstChild("CursedMM2Gui") then
	CoreGui.CursedMM2Gui:Destroy()
end

-- ========================================================
--  GUI CREATION
-- ========================================================

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "CursedMM2Gui"
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = CoreGui

-- Main Frame (Gray Theme)
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 320, 0, 390)
MainFrame.Position = UDim2.new(0.5, -160, 0.3, -195)
MainFrame.BackgroundColor3 = Color3.fromRGB(45, 47, 52)
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.Parent = ScreenGui

local MainUICorner = Instance.new("UICorner")
MainUICorner.CornerRadius = UDim.new(0, 8)
MainUICorner.Parent = MainFrame

-- Topbar
local TopBar = Instance.new("Frame")
TopBar.Size = UDim2.new(1, 0, 0, 35)
TopBar.BackgroundColor3 = Color3.fromRGB(28, 29, 33)
TopBar.BorderSizePixel = 0
TopBar.Parent = MainFrame

local TopBarCorner = Instance.new("UICorner")
TopBarCorner.CornerRadius = UDim.new(0, 8)
TopBarCorner.Parent = TopBar

local TopBarFix = Instance.new("Frame")
TopBarFix.Size = UDim2.new(1, 0, 0, 10)
TopBarFix.Position = UDim2.new(0, 0, 1, -10)
TopBarFix.BackgroundColor3 = Color3.fromRGB(28, 29, 33)
TopBarFix.BorderSizePixel = 0
TopBarFix.Parent = TopBar

-- Title
local TitleLabel = Instance.new("TextLabel")
TitleLabel.Size = UDim2.new(1, -50, 1, 0)
TitleLabel.Position = UDim2.new(0, 12, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.Text = "MM2 MENU BY CURSED GUY"
TitleLabel.TextColor3 = Color3.fromRGB(220, 221, 222)
TitleLabel.TextSize = 13
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.Parent = TopBar

-- Minimize Button
local MinimizeBtn = Instance.new("TextButton")
MinimizeBtn.Size = UDim2.new(0, 30, 0, 30)
MinimizeBtn.Position = UDim2.new(1, -33, 0, 2)
MinimizeBtn.BackgroundTransparency = 1
MinimizeBtn.Text = "—"
MinimizeBtn.TextColor3 = Color3.fromRGB(185, 187, 190)
MinimizeBtn.TextSize = 16
MinimizeBtn.Font = Enum.Font.GothamBold
MinimizeBtn.Parent = TopBar

-- Floating Button (Black with Animated RGB Border)
local OpenBtn = Instance.new("TextButton")
OpenBtn.Name = "OpenButton"
OpenBtn.Size = UDim2.new(0, 140, 0, 50)
OpenBtn.Position = UDim2.new(0, 20, 0.5, -25)
OpenBtn.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
OpenBtn.Text = "MM2 MENU\nBY CURSED GUY"
OpenBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
OpenBtn.TextSize = 12
OpenBtn.Font = Enum.Font.GothamBold
OpenBtn.Visible = false
OpenBtn.Active = true
OpenBtn.Draggable = true
OpenBtn.Parent = ScreenGui

local OpenBtnCorner = Instance.new("UICorner")
OpenBtnCorner.CornerRadius = UDim.new(0, 8)
OpenBtnCorner.Parent = OpenBtn

local RGBStroke = Instance.new("UIStroke")
RGBStroke.Thickness = 2
RGBStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
RGBStroke.Parent = OpenBtn

-- Content Frame
local ContentFrame = Instance.new("Frame")
ContentFrame.Size = UDim2.new(1, -20, 1, -45)
ContentFrame.Position = UDim2.new(0, 10, 0, 40)
ContentFrame.BackgroundTransparency = 1
ContentFrame.Parent = MainFrame

local function CreateButton(text, yPos)
	local btn = Instance.new("TextButton")
	btn.Size = UDim2.new(1, 0, 0, 32)
	btn.Position = UDim2.new(0, 0, 0, yPos)
	btn.BackgroundColor3 = Color3.fromRGB(60, 63, 69)
	btn.Text = text
	btn.TextColor3 = Color3.fromRGB(255, 255, 255)
	btn.TextSize = 11
	btn.Font = Enum.Font.GothamMedium
	btn.Parent = ContentFrame

	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 6)
	corner.Parent = btn

	return btn
end

-- UI Buttons
local EspToggleBtn = CreateButton("ESP Roles & Names: OFF", 0)
local AutoGrabToggleBtn = CreateButton("Auto Grab Gun: OFF", 36)
local AutoAimToggleBtn = CreateButton("Auto Aim & Shoot Murderer: OFF", 72)
local FarmCoinsToggleBtn = CreateButton("Auto Farm Coins (Smooth): OFF", 108)
local FlingMurderBtn = CreateButton("Fling Murderer: OFF", 144)
local FlingSheriffBtn = CreateButton("Fling Sheriff: OFF", 180)
local SelectInnocentBtn = CreateButton("Target: All Innocents (Click to Switch)", 216)
local FlingInnocentBtn = CreateButton("Fling Innocent: OFF", 252)

local InfoLabel = Instance.new("TextLabel")
InfoLabel.Size = UDim2.new(1, 0, 0, 30)
InfoLabel.Position = UDim2.new(0, 0, 0, 290)
InfoLabel.BackgroundTransparency = 1
InfoLabel.Text = "🟢 Innocent | 🔴 Murderer | 🔵 Sheriff | 🔵 Gun Drop"
InfoLabel.TextColor3 = Color3.fromRGB(185, 187, 190)
InfoLabel.TextSize = 10
InfoLabel.Font = Enum.Font.Gotham
InfoLabel.Parent = ContentFrame

-- Animated RGB Effect
RunService.RenderStepped:Connect(function()
	if OpenBtn.Visible then
		local hue = (tick() % 3) / 3
		local rgbColor = Color3.fromHSV(hue, 1, 1)
		RGBStroke.Color = rgbColor
		OpenBtn.TextColor3 = rgbColor
	end
end)

-- ========================================================
--  ESP & UTILITIES
-- ========================================================

local espEnabled = false
local autoGrabEnabled = false
local autoAimEnabled = false
local farmCoinsEnabled = false

local espHighlights = {}
local espNameTags = {}
local gunHighlights = {}

local COLOR_MURDER = Color3.fromRGB(255, 30, 60)
local COLOR_SHERIFF = Color3.fromRGB(0, 162, 255)
local COLOR_INNOCENT = Color3.fromRGB(0, 230, 90)
local COLOR_SPECTATOR = Color3.fromRGB(138, 138, 138)
local COLOR_GUN_DROP = Color3.fromRGB(0, 191, 255)

local function GetPlayerRole(player)
	if not player or not player.Character then return "Spectator" end
	local backpack = player:FindFirstChild("Backpack")
	local character = player.Character
	local humanoid = character:FindFirstChildOfClass("Humanoid")

	if not humanoid or humanoid.Health <= 0 then return "Spectator" end

	if (backpack and backpack:FindFirstChild("Knife")) or (character and character:FindFirstChild("Knife")) then
		return "Murderer"
	end
	if (backpack and backpack:FindFirstChild("Gun")) or (character and character:FindFirstChild("Gun")) then
		return "Sheriff"
	end
	return "Innocent"
end

local function GetRoleColor(role)
	if role == "Murderer" then return COLOR_MURDER
	elseif role == "Sheriff" then return COLOR_SHERIFF
	elseif role == "Innocent" then return COLOR_INNOCENT
	else return COLOR_SPECTATOR
	end
end

local function ClearESP()
	for _, h in pairs(espHighlights) do if h then h:Destroy() end end; table.clear(espHighlights)
	for _, t in pairs(espNameTags) do if t then t:Destroy() end end; table.clear(espNameTags)
	for _, g in pairs(gunHighlights) do if g then g:Destroy() end end; table.clear(gunHighlights)
end

local function ApplyGunESP(gunObj)
	if not gunObj or gunHighlights[gunObj] then return end

	local highlight = Instance.new("Highlight")
	highlight.FillColor = COLOR_GUN_DROP
	highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
	highlight.FillTransparency = 0.2
	highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
	highlight.Parent = gunObj

	local billboard = Instance.new("BillboardGui")
	billboard.AlwaysOnTop = true
	billboard.Size = UDim2.new(0, 140, 0, 30)
	billboard.StudsOffset = Vector3.new(0, 1.8, 0)
	billboard.Parent = gunObj

	local label = Instance.new("TextLabel")
	label.Size = UDim2.new(1, 0, 1, 0)
	label.BackgroundTransparency = 1
	label.Text = "🔫 Sheriff Gun"
	label.TextColor3 = COLOR_GUN_DROP
	label.TextSize = 13
	label.Font = Enum.Font.GothamBold
	label.Parent = billboard

	gunHighlights[gunObj] = highlight
end

local function CheckForDroppedGun()
	for _, child in pairs(Workspace:GetChildren()) do
		if child.Name == "GunDrop" or (child.Name == "Gun" and child:IsA("Tool") and not Players:GetPlayerFromCharacter(child.Parent)) then
			if espEnabled then ApplyGunESP(child) end
			return child
		end
	end
	local gunDropDirect = Workspace:FindFirstChild("GunDrop", true)
	if gunDropDirect then
		if espEnabled then ApplyGunESP(gunDropDirect) end
		return gunDropDirect
	end
	return nil
end

local function UpdateESP()
	if not espEnabled then ClearESP() return end

	for _, player in pairs(Players:GetPlayers()) do
		if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player.Character:FindFirstChild("Head") then
			local char = player.Character
			local role = GetPlayerRole(player)
			local color = GetRoleColor(role)

			local highlight = espHighlights[player]
			if not highlight or highlight.Parent ~= char then
				if highlight then highlight:Destroy() end
				highlight = Instance.new("Highlight")
				highlight.FillTransparency = 0.35
				highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
				highlight.Parent = char
				espHighlights[player] = highlight
			end
			highlight.FillColor = color
			highlight.OutlineColor = color

			local nameTag = espNameTags[player]
			if not nameTag or nameTag.Parent ~= char.Head then
				if nameTag then nameTag:Destroy() end
				nameTag = Instance.new("BillboardGui")
				nameTag.AlwaysOnTop = true
				nameTag.Size = UDim2.new(0, 160, 0, 30)
				nameTag.StudsOffset = Vector3.new(0, 2.2, 0)
				nameTag.Parent = char.Head

				local label = Instance.new("TextLabel")
				label.Name = "Label"
				label.Size = UDim2.new(1, 0, 1, 0)
				label.BackgroundTransparency = 1
				label.TextSize = 12
				label.Font = Enum.Font.GothamBold
				label.Parent = nameTag
				espNameTags[player] = nameTag
			end

			local label = nameTag:FindFirstChild("Label")
			if label then
				label.Text = player.DisplayName .. " [" .. role .. "]"
				label.TextColor3 = color
			end
		else
			if espHighlights[player] then espHighlights[player]:Destroy() espHighlights[player] = nil end
			if espNameTags[player] then espNameTags[player]:Destroy() espNameTags[player] = nil end
		end
	end
	CheckForDroppedGun()
end

-- Auto Grab Gun
local function AutoGrabGunLogic()
	if not autoGrabEnabled then return end
	local droppedGun = CheckForDroppedGun()
	if droppedGun and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
		local myRoot = LocalPlayer.Character.HumanoidRootPart
		local originalCFrame = myRoot.CFrame
		local gunPart = droppedGun:IsA("BasePart") and droppedGun or droppedGun:FindFirstChildOfClass("BasePart")
		if gunPart then
			myRoot.CFrame = gunPart.CFrame
			task.wait(0.05)
			myRoot.CFrame = originalCFrame
		end
	end
end

-- ==========================================================
--  AUTO AIM & AUTO SHOOT MURDERER
-- ==========================================================

local function AutoAimLogic()
	if not autoAimEnabled or not LocalPlayer.Character then return end
	local gun = LocalPlayer.Character:FindFirstChild("Gun")
	if not gun then return end

	local murdererPlayer = nil
	for _, p in pairs(Players:GetPlayers()) do
		if p ~= LocalPlayer and GetRoleColor(GetPlayerRole(p)) == COLOR_MURDER then
			murdererPlayer = p
			break
		end
	end

	if murdererPlayer and murdererPlayer.Character and murdererPlayer.Character:FindFirstChild("HumanoidRootPart") then
		local mRoot = murdererPlayer.Character.HumanoidRootPart
		local camera = Workspace.CurrentCamera
		camera.CFrame = CFrame.new(camera.CFrame.Position, mRoot.Position)
		gun:Activate()
	end
end

-- ==========================================================
--  AUTO FARM COINS (SMOOTH & 20% SLOWER)
-- ==========================================================

local function GetCoinContainer()
	for _, child in pairs(Workspace:GetChildren()) do
		if child:FindFirstChild("CoinContainer") then
			return child.CoinContainer
		end
	end
	return Workspace:FindFirstChild("CoinContainer", true)
end

task.spawn(function()
	while true do
		task.wait(0.1)
		if farmCoinsEnabled and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
			local myRoot = LocalPlayer.Character.HumanoidRootPart
			local coinContainer = GetCoinContainer()
			
			if coinContainer then
				for _, coin in pairs(coinContainer:GetChildren()) do
					if not farmCoinsEnabled then break end
					local coinPart = coin:IsA("BasePart") and coin or coin:FindFirstChildOfClass("BasePart")
					if coinPart then
						-- Tempo aumentato del 20% (da 0.15 a 0.18) per renderlo più lento e fluido
						local tweenInfo = TweenInfo.new(0.18, Enum.EasingStyle.Linear)
						local tweenService = game:GetService("TweenService")
						local tween = tweenService:Create(myRoot, tweenInfo, {CFrame = coinPart.CFrame})
						tween:Play()
						tween.Completed:Wait()
					end
				end
			end
		end
	end
end)

-- ========================================================
--  INSTANT FLING LOGIC
-- ========================================================

local flingMurderActive = false
local flingSheriffActive = false
local flingInnocentActive = false
local selectedInnocentIndex = 0

local function GetInnocentList()
	local list = {}
	for _, p in pairs(Players:GetPlayers()) do
		if p ~= LocalPlayer and GetPlayerRole(p) == "Innocent" then
			table.insert(list, p)
		end
	end
	return list
end

local noclipConnection
local function EnableNoclip(enable)
	if enable then
		if not noclipConnection then
			noclipConnection = RunService.Stepped:Connect(function()
				if LocalPlayer.Character then
					for _, part in pairs(LocalPlayer.Character:GetDescendants()) do
						if part:IsA("BasePart") then part.CanCollide = false end
					end
				end
			end)
		end
	else
		if noclipConnection then
			noclipConnection:Disconnect()
			noclipConnection = nil
		end
	end
end

local function PerformInstantFling(targetPlayer)
	if not targetPlayer or targetPlayer == LocalPlayer or not targetPlayer.Character then return end
	local targetRoot = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
	local myChar = LocalPlayer.Character
	if not myChar then return end
	local myRoot = myChar:FindFirstChild("HumanoidRootPart")
	local myHumanoid = myChar:FindFirstChildOfClass("Humanoid")

	if not targetRoot or not myRoot or not myHumanoid then return end

	local originalCFrame = myRoot.CFrame
	EnableNoclip(true)

	local bav = Instance.new("BodyAngularVelocity")
	bav.AngularVelocity = Vector3.new(100000000, 100000000, 100000000)
	bav.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
	bav.P = math.huge
	bav.Parent = myRoot

	local startTime = os.clock()

	while (os.clock() - startTime < 0.8) and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") and myHumanoid.Health > 0 do
		if not (flingMurderActive or flingSheriffActive or flingInnocentActive) then break end

		local tRoot = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
		if not tRoot then break end

		myRoot.CFrame = tRoot.CFrame * CFrame.new(math.random(-1, 1) * 0.1, 0, math.random(-1, 1) * 0.1) * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), 0)
		myRoot.Velocity = Vector3.new(9999, 9999, 9999)

		RunService.Heartbeat:Wait()
	end

	if bav then bav:Destroy() end
	EnableNoclip(false)

	if myRoot and myHumanoid.Health > 0 then
		myRoot.CFrame = originalCFrame
		myRoot.Velocity = Vector3.zero
		myRoot.RotVelocity = Vector3.zero
	end
end

-- Fling loop
task.spawn(function()
	while true do
		task.wait(0.01)
		if flingMurderActive or flingSheriffActive or flingInnocentActive then
			if flingMurderActive then
				for _, p in pairs(Players:GetPlayers()) do
					if flingMurderActive and GetPlayerRole(p) == "Murderer" then PerformInstantFling(p) end
				end
			elseif flingSheriffActive then
				for _, p in pairs(Players:GetPlayers()) do
					if flingSheriffActive and GetPlayerRole(p) == "Sheriff" then PerformInstantFling(p) end
				end
			elseif flingInnocentActive then
				local innocents = GetInnocentList()
				if selectedInnocentIndex == 0 then
					for _, p in pairs(innocents) do
						if flingInnocentActive then PerformInstantFling(p) end
					end
				else
					local target = innocents[selectedInnocentIndex]
					if target and flingInnocentActive then PerformInstantFling(target) end
				end
			end
		end
	end
end)

-- Render Loops
RunService.RenderStepped:Connect(function()
	if espEnabled then UpdateESP() end
	if autoGrabEnabled then AutoGrabGunLogic() end
	if autoAimEnabled then AutoAimLogic() end
end)

Players.PlayerRemoving:Connect(function(player)
	if espHighlights[player] then espHighlights[player]:Destroy() espHighlights[player] = nil end
	if espNameTags[player] then espNameTags[player]:Destroy() espNameTags[player] = nil end
end)

-- ========================================================
--  UI EVENTS
-- ========================================================

EspToggleBtn.MouseButton1Click:Connect(function()
	espEnabled = not espEnabled
	EspToggleBtn.Text = espEnabled and "ESP Roles & Names: ON" or "ESP Roles & Names: OFF"
	EspToggleBtn.BackgroundColor3 = espEnabled and Color3.fromRGB(88, 101, 242) or Color3.fromRGB(60, 63, 69)
	if not espEnabled then ClearESP() end
end)

AutoGrabToggleBtn.MouseButton1Click:Connect(function()
	autoGrabEnabled = not autoGrabEnabled
	AutoGrabToggleBtn.Text = autoGrabEnabled and "Auto Grab Gun: ON" or "Auto Grab Gun: OFF"
	AutoGrabToggleBtn.BackgroundColor3 = autoGrabEnabled and Color3.fromRGB(88, 101, 242) or Color3.fromRGB(60, 63, 69)
end)

AutoAimToggleBtn.MouseButton1Click:Connect(function()
	autoAimEnabled = not autoAimEnabled
	AutoAimToggleBtn.Text = autoAimEnabled and "Auto Aim & Shoot Murderer: ON" or "Auto Aim & Shoot Murderer: OFF"
	AutoAimToggleBtn.BackgroundColor3 = autoAimEnabled and Color3.fromRGB(88, 101, 242) or Color3.fromRGB(60, 63, 69)
end)

FarmCoinsToggleBtn.MouseButton1Click:Connect(function()
	farmCoinsEnabled = not farmCoinsEnabled
	FarmCoinsToggleBtn.Text = farmCoinsEnabled and "Auto Farm Coins (Smooth): ON" or "Auto Farm Coins (Smooth): OFF"
	FarmCoinsToggleBtn.BackgroundColor3 = farmCoinsEnabled and Color3.fromRGB(88, 101, 242) or Color3.fromRGB(60, 63, 69)
end)

FlingMurderBtn.MouseButton1Click:Connect(function()
	flingMurderActive = not flingMurderActive
	FlingMurderBtn.Text = flingMurderActive and "Fling Murderer: ON" or "Fling Murderer: OFF"
	FlingMurderBtn.BackgroundColor3 = flingMurderActive and Color3.fromRGB(240, 71, 71) or Color3.fromRGB(60, 63, 69)
end)

FlingSheriffBtn.MouseButton1Click:Connect(function()
	flingSheriffActive = not flingSheriffActive
	FlingSheriffBtn.Text = flingSheriffActive and "Fling Sheriff: ON" or "Fling Sheriff: OFF"
	FlingSheriffBtn.BackgroundColor3 = flingSheriffActive and Color3.fromRGB(0, 176, 244) or Color3.fromRGB(60, 63, 69)
end)

SelectInnocentBtn.MouseButton1Click:Connect(function()
	local innocents = GetInnocentList()
	if #innocents == 0 then
		SelectInnocentBtn.Text = "Target: No Innocents Found"
		selectedInnocentIndex = 0
		return
	end

	selectedInnocentIndex = selectedInnocentIndex + 1
	if selectedInnocentIndex > #innocents then
		selectedInnocentIndex = 0
		SelectInnocentBtn.Text = "Target: All Innocents"
	else
		local targetPlayer = innocents[selectedInnocentIndex]
		SelectInnocentBtn.Text = "Target: " .. targetPlayer.DisplayName
	end
end)

FlingInnocentBtn.MouseButton1Click:Connect(function()
	flingInnocentActive = not flingInnocentActive
	FlingInnocentBtn.Text = flingInnocentActive and "Fling Innocent: ON" or "Fling Innocent: OFF"
	FlingInnocentBtn.BackgroundColor3 = flingInnocentActive and Color3.fromRGB(67, 181, 129) or Color3.fromRGB(60, 63, 69)
end)

MinimizeBtn.MouseButton1Click:Connect(function()
	MainFrame.Visible = false
	OpenBtn.Visible = true
end)

OpenBtn.MouseButton1Click:Connect(function()
	MainFrame.Visible = true
	OpenBtn.Visible = false
end)
29

Roblox Murder Mystery 2: Waguri MM2 Script V2.67

keyless working mobile

Seconds Life (Godmode): Prevents instant death and boosts survival.

loadstring(game:HttpGet("https://raw.githubusercontent.com/Waguriiiii/Murder-mystery-2/refs/heads/main/Waguri.lua"))()
by Waguri Hub raw.githubusercontent.com updated 2 Nov 2026 2.7k views 1 loader source ↗
30

Westwell | Murder Mystery 2 Script

key system working Round & Role Round Info, Death Logs & Role RevealsCombat Knife / Gun AutomationHitbox & Aim AssistanceMurderer Follow / AvoidanceESP & Visuals Role / Gun / Coin ESPChams, FOV & LightingPlayer & Movement God Mode

Round Info, Death Logs & Role Reveals

loadstring(game:HttpGet("https://api.jnkie.com/api/v1/loaders/public/db030a8e7623efa9647d6a9864f76d6b3234d17500326b41c81a7245d35ab29e/download"))()
api.jnkie.com updated 2 Nov 2026 598 views 1 loader source ↗
31

Kazz Hub silent aim, wallbang, flickshot

key system working mobile

High-performance script for Murder Mystery 2 powered by aminzz1. It features Silent Aim, Gun & Knife Aura, Hitbox Expander, Auto Grab Gun, Movement Exploits (Teleports, Auto Kill All), full Player/Role ESP (Sheriff & Murderer tracking), customizable Visuals/World Effects, and 5 anime themes with mobile support.

loadstring(game:HttpGet("https://api.jnkie.com/api/v1/loaders/public/353accd2d41a5a30c879705a8ff47926fab2c8b7d7baf34d31c0522b8c6c0a41/download"))()
api.jnkie.com updated 2 Nov 2026 499 views 1 loader source ↗
32

Axon Hub | Silent Aim, Auto Farm & ESP

key system working mobile Silent AimAuto Farm & ESP

Axon Hub is a Murder Mystery 2 script built for auto farm, ESP, combat, movement and easier grinding.

loadstring(game:HttpGet("https://api.luarmor.net/files/v3/loaders/97c3f6db55a2cf72141537a85458e5a7.lua"))()
api.luarmor.net updated 1 Nov 2026 256 views 1 loader source ↗
33

Axonic Murder Mystery 2 Keyless

keyless working mobile

Murder Mystery 2 script very op one of the best scripts out there hope you enjoy and uhhh has hella crazy features wall bangs pretty much can shoot from walls etc

loadstring(game:HttpGet("https://raw.githubusercontent.com/Kenniel123/Axonic-MM2/refs/heads/main/Axonic%20MM2"))()
raw.githubusercontent.com updated 2 Nov 2026 1.3k views 0 loader source ↗
35

(UPGRADED!) | ELITE MM2 Script| OP Role ESP, Aimbot, And Fly| Free and Keyless!

keyless working ELITE MM2 Script| OP Role ESPAimbotAnd Fly| Free and Keyless! |

OP Aimbot, Role ESP, Fly, and everything else YOU need to dominate in MM2!. Works on any executor, ( I made sure it work on Xeno, and Solara) since it was a constant issue I saw with other scripts. Feel free to check out my profile and join my NEW Discord server!Thank you for using Elite Scripts &lt;3,

--[[
inline updated 2 Nov 2026 452 views 0
full source (45680 chars)
--[[
    ELITE SCRIPTS  ·  MURDER MYSTERY 2
    Fluent UI 
    Role ESP (Murderer/Sheriff/Innocent) · Coin ESP · Gun Drop ESP
    Aimbot / Silent / Knife Aura · Auto Farm · Auto Shoot · Auto Stab
    TP to roles · Fly / Noclip / Speed · FullBright · Discord LED
    Customize tab — accent + theme colors
    Keyless · UNC universal
]]

-- ======================== UNC / EXECUTOR COMPAT ========================
local function safeHttpGet(url)
    local ok, res = pcall(function()
        if syn and syn.request then
            local r = syn.request({Url = url, Method = "GET"})
            return r.Body
        elseif http and http.request then
            local r = http.request({Url = url, Method = "GET"})
            return r.Body
        elseif request then
            local r = request({Url = url, Method = "GET"})
            return r.Body
        elseif http_request then
            local r = http_request({Url = url, Method = "GET"})
            return r.Body
        elseif fluxus and fluxus.request then
            local r = fluxus.request({Url = url, Method = "GET"})
            return r.Body
        else
            return game:HttpGet(url)
        end
    end)
    if ok and res then return res end
    return game:HttpGet(url)
end

local Fluent = loadstring(safeHttpGet("https://github.com/dawid-scripts/Fluent/releases/latest/download/main.lua"))()
local SaveManager = loadstring(safeHttpGet("https://raw.githubusercontent.com/dawid-scripts/Fluent/master/Addons/SaveManager.lua"))()
local InterfaceManager = loadstring(safeHttpGet("https://raw.githubusercontent.com/dawid-scripts/Fluent/master/Addons/InterfaceManager.lua"))()

if not Drawing then
    pcall(function() Drawing = getgenv().Drawing or Drawing end)
end
if not Drawing then
    warn("[ELITE SCRIPTS] Drawing missing — ESP disabled on this executor")
end

local function safeDrawing(class)
    if not Drawing then return nil end
    local ok, obj = pcall(function() return Drawing.new(class) end)
    if ok then return obj end
    return nil
end

local function safeMousemove(x, y)
    if mousemoverel then
        pcall(mousemoverel, x, y)
    elseif Input and Input.MouseMove then
        pcall(Input.MouseMove, x, y)
    end
end

local function safeMouse1Click()
    if mouse1click then
        pcall(mouse1click)
    elseif mouse1press and mouse1release then
        pcall(mouse1press)
        task.wait(0.02)
        pcall(mouse1release)
    end
end

-- ======================== SERVICES ========================
local Players          = game:GetService("Players")
local RunService       = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace        = game:GetService("Workspace")
local Lighting         = game:GetService("Lighting")
local TweenService     = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local LocalPlayer = Players.LocalPlayer
local Camera      = Workspace.CurrentCamera
local Mouse       = LocalPlayer:GetMouse()

-- ======================== SETTINGS ========================
local S = {
    -- Aim
    Aimbot        = false,
    SilentAim     = false,
    AlwaysOn      = false,
    AimKey        = Enum.UserInputType.MouseButton2,
    FOV           = 130,
    Smoothness    = 0.14,
    AimPart       = "Head",
    Prediction    = true,
    PredMult      = 0.09,
    ShowFOV       = true,
    FOVColor      = Color3.fromRGB(188, 78, 255),
    FOVRainbow    = false,
    TargetRole    = "Murderer", -- Murderer / Sheriff / Any

    -- Combat MM2
    KnifeAura     = false,
    AuraDist      = 12,
    AutoStab      = false,
    AutoShoot     = false,
    AutoThrow     = false,
    KillAll       = false,

    -- ESP
    ESP           = true,
    RoleESP       = true,
    Box           = true,
    Skeleton      = false,
    Tracer        = true,
    Name          = true,
    Distance      = true,
    Health        = true,
    CoinESP       = true,
    GunESP        = true,
    MaxDist       = 2500,
    MurdererColor = Color3.fromRGB(255, 55, 55),
    SheriffColor  = Color3.fromRGB(55, 140, 255),
    InnocentColor = Color3.fromRGB(80, 220, 120),
    CoinColor     = Color3.fromRGB(255, 215, 60),
    GunColor      = Color3.fromRGB(100, 180, 255),

    -- Farm
    AutoFarm      = false,
    FarmSpeed     = 28,
    FarmMode      = "Nearest", -- Nearest / Random
    AutoGrabGun   = true,
    AutoOpenChest = false,

    -- Movement
    Fly           = false,
    FlySpeed      = 70,
    Noclip        = false,
    Speed         = false,
    WalkSpeed     = 26,
    InfiniteJump  = false,

    -- World
    FullBright    = false,
    NoFog         = false,

    -- UI / Brand
    DiscordLED       = true,
    DiscordLEDColor  = Color3.fromRGB(188, 78, 255),
    DiscordLink      = "https://discord.gg/JyHTa3M7h",
    AccentColor      = Color3.fromRGB(188, 78, 255),
    ThemeName        = "Darker",
}

-- ======================== STATE ========================
local HoldingAim = false
local espCache   = {}
local coinCache  = {}
local gunCache   = {}
local flyBV, flyBG
local origAmbient, origBrightness, origFog
local lastAura   = 0
local lastFarm   = 0
local roleCache  = {} -- [player] = "Murderer"|"Sheriff"|"Innocent"|"None"

-- Drawing objects
local FOVCircle = safeDrawing("Circle")
if FOVCircle then
    FOVCircle.Visible = false
    FOVCircle.Thickness = 1.4
    FOVCircle.Filled = false
    FOVCircle.NumSides = 64
    FOVCircle.Transparency = 0.75
    FOVCircle.Color = S.FOVColor
    FOVCircle.Radius = S.FOV
end

local DiscordLEDGlow = safeDrawing("Text")
local DiscordLEDText = safeDrawing("Text")
local DiscordLEDLine = safeDrawing("Line")
if DiscordLEDGlow then
    DiscordLEDGlow.Text = "discord.gg/JyHTa3M7h"
    DiscordLEDGlow.Size = 13
    DiscordLEDGlow.Center = true
    DiscordLEDGlow.Outline = false
    DiscordLEDGlow.Color = S.DiscordLEDColor
    DiscordLEDGlow.Transparency = 0.72
    DiscordLEDGlow.Visible = S.DiscordLED
end
if DiscordLEDText then
    DiscordLEDText.Text = "discord.gg/JyHTa3M7h"
    DiscordLEDText.Size = 12
    DiscordLEDText.Center = true
    DiscordLEDText.Outline = true
    DiscordLEDText.Color = S.DiscordLEDColor
    DiscordLEDText.Transparency = 1
    DiscordLEDText.Visible = S.DiscordLED
end
if DiscordLEDLine then
    DiscordLEDLine.Thickness = 1
    DiscordLEDLine.Color = S.DiscordLEDColor
    DiscordLEDLine.Transparency = 0.6
    DiscordLEDLine.Visible = S.DiscordLED
end

-- ======================== ROLE DETECTION ========================
local function getRole(plr)
    if not plr or plr == LocalPlayer then return "None" end
    if roleCache[plr] and tick() - (roleCache[plr]._t or 0) < 0.8 then
        return roleCache[plr].role
    end

    local role = "Innocent"
    local char = plr.Character
    if not char then
        roleCache[plr] = { role = "None", _t = tick() }
        return "None"
    end

    -- Common MM2 patterns: Knife = Murderer, Gun/Revolver = Sheriff
    local hasKnife, hasGun = false, false
    for _, tool in ipairs(char:GetChildren()) do
        if tool:IsA("Tool") then
            local n = string.lower(tool.Name)
            if n:find("knife") or n:find("blade") or n:find("dagger") or n:find("sword") then
                hasKnife = true
            end
            if n:find("gun") or n:find("revolver") or n:find("pistol") or n:find("sheriff") then
                hasGun = true
            end
        end
    end
    -- Also check backpack
    local bp = plr:FindFirstChild("Backpack")
    if bp then
        for _, tool in ipairs(bp:GetChildren()) do
            if tool:IsA("Tool") then
                local n = string.lower(tool.Name)
                if n:find("knife") or n:find("blade") or n:find("dagger") then hasKnife = true end
                if n:find("gun") or n:find("revolver") or n:find("pistol") then hasGun = true end
            end
        end
    end

    -- Value / attribute fallbacks used by some MM2 forks
    local ok, val = pcall(function()
        local r = plr:FindFirstChild("Role") or plr:FindFirstChild("role") or char:FindFirstChild("Role")
        if r and (r:IsA("StringValue") or r:IsA("StringValue")) then
            return tostring(r.Value)
        end
        if plr:GetAttribute("Role") then return tostring(plr:GetAttribute("Role")) end
        if char:GetAttribute("Role") then return tostring(char:GetAttribute("Role")) end
        return nil
    end)
    if ok and val then
        local l = string.lower(val)
        if l:find("murder") then role = "Murderer"
        elseif l:find("sheriff") or l:find("hero") then role = "Sheriff"
        elseif l:find("innocent") then role = "Innocent"
        end
    else
        if hasKnife then role = "Murderer"
        elseif hasGun then role = "Sheriff"
        else role = "Innocent"
        end
    end

    roleCache[plr] = { role = role, _t = tick() }
    return role
end

local function getRoleColor(role)
    if role == "Murderer" then return S.MurdererColor
    elseif role == "Sheriff" then return S.SheriffColor
    else return S.InnocentColor
    end
end

-- ======================== HELPERS ========================
local function getChar(plr)
    return plr and plr.Character
end

local function getHRP(plr)
    local c = getChar(plr)
    return c and c:FindFirstChild("HumanoidRootPart")
end

local function getHum(plr)
    local c = getChar(plr)
    return c and c:FindFirstChildOfClass("Humanoid")
end

local function isAlive(plr)
    local h = getHum(plr)
    return h and h.Health > 0
end

local function worldToScreen(pos)
    local v, on = Camera:WorldToViewportPoint(pos)
    return Vector2.new(v.X, v.Y), on, v.Z
end

local function getClosestInFOV(roleFilter)
    local best, bestDist = nil, S.FOV
    local mousePos = Vector2.new(Mouse.X, Mouse.Y)
    for _, plr in ipairs(Players:GetPlayers()) do
        if plr ~= LocalPlayer and isAlive(plr) then
            local role = getRole(plr)
            if roleFilter == "Any" or role == roleFilter then
                local hrp = getHRP(plr)
                if hrp then
                    local part = hrp
                    if S.AimPart == "Head" then
                        local head = getChar(plr):FindFirstChild("Head")
                        if head then part = head end
                    end
                    local screen, onScreen = worldToScreen(part.Position)
                    if onScreen then
                        local d = (screen - mousePos).Magnitude
                        if d < bestDist then
                            bestDist = d
                            best = part
                        end
                    end
                end
            end
        end
    end
    return best
end

local function aimAt(part)
    if not part then return end
    local pos = part.Position
    if S.Prediction and part.Parent then
        local hrp = part.Parent:FindFirstChild("HumanoidRootPart") or part
        local vel = hrp.AssemblyLinearVelocity or hrp.Velocity or Vector3.zero
        pos = pos + vel * S.PredMult
    end
    local screen, on = worldToScreen(pos)
    if not on then return end
    local mousePos = Vector2.new(Mouse.X, Mouse.Y)
    local delta = (screen - mousePos) * math.clamp(1 - S.Smoothness, 0.05, 1)
    safeMousemove(delta.X, delta.Y)
end

-- ======================== ESP SYSTEM ========================
local function clearESP(plr)
    local c = espCache[plr]
    if not c then return end
    for _, obj in pairs(c) do
        pcall(function() if obj.Remove then obj:Remove() end end)
    end
    espCache[plr] = nil
end

local function ensureESP(plr)
    if espCache[plr] then return espCache[plr] end
    local c = {
        box = safeDrawing("Square"),
        name = safeDrawing("Text"),
        dist = safeDrawing("Text"),
        health = safeDrawing("Line"),
        tracer = safeDrawing("Line"),
        skel = {},
    }
    if c.box then
        c.box.Thickness = 1.3
        c.box.Filled = false
        c.box.Transparency = 1
    end
    if c.name then
        c.name.Size = 13
        c.name.Center = true
        c.name.Outline = true
        c.name.Transparency = 1
    end
    if c.dist then
        c.dist.Size = 12
        c.dist.Center = true
        c.dist.Outline = true
        c.dist.Transparency = 1
    end
    if c.health then
        c.health.Thickness = 2.2
        c.health.Transparency = 1
    end
    if c.tracer then
        c.tracer.Thickness = 1.2
        c.tracer.Transparency = 0.85
    end
    for i = 1, 12 do
        local ln = safeDrawing("Line")
        if ln then
            ln.Thickness = 1.1
            ln.Transparency = 1
            c.skel[i] = ln
        end
    end
    espCache[plr] = c
    return c
end

local function updatePlayerESP()
    if not S.ESP then
        for plr in pairs(espCache) do clearESP(plr) end
        return
    end
    local myHRP = getHRP(LocalPlayer)
    local myPos = myHRP and myHRP.Position or Camera.CFrame.Position
    local bottom = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)

    for _, plr in ipairs(Players:GetPlayers()) do
        if plr == LocalPlayer then continue end
        local char = getChar(plr)
        local hrp = getHRP(plr)
        local hum = getHum(plr)
        if not (char and hrp and hum and hum.Health > 0) then
            clearESP(plr)
            continue
        end

        local dist = (hrp.Position - myPos).Magnitude
        if dist > S.MaxDist then
            clearESP(plr)
            continue
        end

        local role = getRole(plr)
        local col = getRoleColor(role)
        local c = ensureESP(plr)

        local head = char:FindFirstChild("Head")
        local topPos = head and head.Position or (hrp.Position + Vector3.new(0, 2.2, 0))
        local bottomPos = hrp.Position - Vector3.new(0, 3, 0)

        local top2d, on1, z1 = worldToScreen(topPos)
        local bot2d, on2 = worldToScreen(bottomPos)
        local hrp2d = worldToScreen(hrp.Position)

        if not (on1 and on2) then
            if c.box then c.box.Visible = false end
            if c.name then c.name.Visible = false end
            if c.dist then c.dist.Visible = false end
            if c.health then c.health.Visible = false end
            if c.tracer then c.tracer.Visible = false end
            for _, ln in pairs(c.skel) do if ln then ln.Visible = false end end
            continue
        end

        local height = math.abs(bot2d.Y - top2d.Y)
        local width = height * 0.55
        local boxPos = Vector2.new(top2d.X - width / 2, top2d.Y)

        if S.Box and c.box then
            c.box.Visible = true
            c.box.Position = boxPos
            c.box.Size = Vector2.new(width, height)
            c.box.Color = col
        elseif c.box then
            c.box.Visible = false
        end

        if S.Name and c.name then
            c.name.Visible = true
            c.name.Position = Vector2.new(top2d.X, top2d.Y - 16)
            local roleTag = S.RoleESP and (" [" .. role .. "]") or ""
            c.name.Text = plr.Name .. roleTag
            c.name.Color = col
        elseif c.name then
            c.name.Visible = false
        end

        if S.Distance and c.dist then
            c.dist.Visible = true
            c.dist.Position = Vector2.new(bot2d.X, bot2d.Y + 2)
            c.dist.Text = string.format("%.0fm", dist)
            c.dist.Color = col
        elseif c.dist then
            c.dist.Visible = false
        end

        if S.Health and c.health then
            local pct = math.clamp(hum.Health / math.max(hum.MaxHealth, 1), 0, 1)
            c.health.Visible = true
            c.health.From = Vector2.new(boxPos.X - 4, bot2d.Y)
            c.health.To = Vector2.new(boxPos.X - 4, bot2d.Y - height * pct)
            c.health.Color = Color3.fromRGB(255 * (1 - pct), 255 * pct, 40)
        elseif c.health then
            c.health.Visible = false
        end

        if S.Tracer and c.tracer then
            c.tracer.Visible = true
            c.tracer.From = bottom
            c.tracer.To = hrp2d
            c.tracer.Color = col
        elseif c.tracer then
            c.tracer.Visible = false
        end

        -- simple skeleton
        if S.Skeleton then
            local bones = {
                {"Head", "UpperTorso"}, {"UpperTorso", "LowerTorso"},
                {"UpperTorso", "LeftUpperArm"}, {"LeftUpperArm", "LeftLowerArm"}, {"LeftLowerArm", "LeftHand"},
                {"UpperTorso", "RightUpperArm"}, {"RightUpperArm", "RightLowerArm"}, {"RightLowerArm", "RightHand"},
                {"LowerTorso", "LeftUpperLeg"}, {"LeftUpperLeg", "LeftLowerLeg"}, {"LeftLowerLeg", "LeftFoot"},
                {"LowerTorso", "RightUpperLeg"}, {"RightUpperLeg", "RightLowerLeg"}, {"RightLowerLeg", "RightFoot"},
            }
            -- R6 fallback
            if not char:FindFirstChild("UpperTorso") then
                bones = {
                    {"Head", "Torso"}, {"Torso", "Left Arm"}, {"Torso", "Right Arm"},
                    {"Torso", "Left Leg"}, {"Torso", "Right Leg"},
                }
            end
            for i, pair in ipairs(bones) do
                local a = char:FindFirstChild(pair[1])
                local b = char:FindFirstChild(pair[2])
                local ln = c.skel[i]
                if a and b and ln then
                    local p1, o1 = worldToScreen(a.Position)
                    local p2, o2 = worldToScreen(b.Position)
                    if o1 and o2 then
                        ln.Visible = true
                        ln.From = p1
                        ln.To = p2
                        ln.Color = col
                    else
                        ln.Visible = false
                    end
                elseif ln then
                    ln.Visible = false
                end
            end
        else
            for _, ln in pairs(c.skel) do if ln then ln.Visible = false end end
        end
    end

    -- cleanup left players
    for plr in pairs(espCache) do
        if not Players:FindFirstChild(plr.Name) then
            clearESP(plr)
        end
    end
end

-- Coin + Gun ESP (simple)
local function updateWorldESP()
    -- Coins
    if S.CoinESP then
        for _, obj in ipairs(Workspace:GetDescendants()) do
            if obj:IsA("BasePart") and (string.lower(obj.Name):find("coin") or obj.Name == "CoinContainer") then
                if not coinCache[obj] then
                    local t = safeDrawing("Text")
                    if t then
                        t.Size = 12
                        t.Center = true
                        t.Outline = true
                        t.Color = S.CoinColor
                        t.Text = "COIN"
                        coinCache[obj] = t
                    end
                end
                local t = coinCache[obj]
                if t then
                    local p, on = worldToScreen(obj.Position)
                    t.Visible = on
                    if on then t.Position = p end
                end
            end
        end
    else
        for obj, t in pairs(coinCache) do
            pcall(function() t:Remove() end)
            coinCache[obj] = nil
        end
    end

    -- Dropped gun
    if S.GunESP then
        for _, obj in ipairs(Workspace:GetDescendants()) do
            if obj:IsA("BasePart") or obj:IsA("Model") then
                local n = string.lower(obj.Name)
                if n:find("gun") or n:find("revolver") or n == "gundrop" then
                    local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart")
                    if part and not gunCache[obj] then
                        local t = safeDrawing("Text")
                        if t then
                            t.Size = 13
                            t.Center = true
                            t.Outline = true
                            t.Color = S.GunColor
                            t.Text = "GUN"
                            gunCache[obj] = t
                        end
                    end
                    local t = gunCache[obj]
                    if t and part then
                        local p, on = worldToScreen(part.Position)
                        t.Visible = on
                        if on then t.Position = p end
                    end
                end
            end
        end
    else
        for obj, t in pairs(gunCache) do
            pcall(function() t:Remove() end)
            gunCache[obj] = nil
        end
    end
end

-- ======================== COMBAT ========================
local function knifeAuraStep()
    if not (S.KnifeAura or S.AutoStab or S.KillAll) then return end
    if tick() - lastAura < 0.12 then return end
    local myChar = LocalPlayer.Character
    if not myChar then return end
    local myHRP = myChar:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    local tool = myChar:FindFirstChildOfClass("Tool")
    local isKnife = tool and string.lower(tool.Name):find("knife")

    for _, plr in ipairs(Players:GetPlayers()) do
        if plr == LocalPlayer or not isAlive(plr) then continue end
        local hrp = getHRP(plr)
        if not hrp then continue end
        local dist = (hrp.Position - myHRP.Position).Magnitude
        if dist <= S.AuraDist then
            if S.KillAll or S.KnifeAura or S.AutoStab then
                -- try activate tool / click
                pcall(function()
                    if tool and tool:FindFirstChild("Handle") then
                        tool:Activate()
                    end
                    safeMouse1Click()
                end)
                lastAura = tick()
                break
            end
        end
    end
end

local function autoShootStep()
    if not S.AutoShoot then return end
    local myChar = LocalPlayer.Character
    if not myChar then return end
    local tool = myChar:FindFirstChildOfClass("Tool")
    if not tool then return end
    local n = string.lower(tool.Name)
    if not (n:find("gun") or n:find("revolver") or n:find("pistol")) then return end

    local target = getClosestInFOV("Murderer")
    if target then
        aimAt(target)
        safeMouse1Click()
    end
end

-- ======================== FARM ========================
local function farmStep()
    if not S.AutoFarm then return end
    if tick() - lastFarm < 0.15 then return end
    local myChar = LocalPlayer.Character
    local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    local best, bestD = nil, math.huge
    for _, obj in ipairs(Workspace:GetDescendants()) do
        if obj:IsA("BasePart") and string.lower(obj.Name):find("coin") then
            local d = (obj.Position - myHRP.Position).Magnitude
            if d < bestD then
                bestD = d
                best = obj
            end
        end
    end

    if best then
        local target = best.Position + Vector3.new(0, 2, 0)
        if S.FarmMode == "Nearest" then
            local dir = (target - myHRP.Position)
            if dir.Magnitude > 2 then
                myHRP.CFrame = myHRP.CFrame:Lerp(CFrame.new(target), 0.18)
            end
        else
            myHRP.CFrame = CFrame.new(target)
        end
        lastFarm = tick()
    end

    if S.AutoGrabGun then
        for _, obj in ipairs(Workspace:GetDescendants()) do
            local n = string.lower(obj.Name)
            if (n:find("gun") or n:find("revolver")) and (obj:IsA("BasePart") or obj:IsA("Model")) then
                local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart")
                if part and (part.Position - myHRP.Position).Magnitude < 18 then
                    myHRP.CFrame = CFrame.new(part.Position + Vector3.new(0, 2, 0))
                    break
                end
            end
        end
    end
end

-- ======================== MOVEMENT ========================
local function flyStep()
    local char = LocalPlayer.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    local hum = char and char:FindFirstChildOfClass("Humanoid")
    if not (hrp and hum) then return end

    if S.Fly then
        if not flyBV then
            flyBV = Instance.new("BodyVelocity")
            flyBV.MaxForce = Vector3.new(1e5, 1e5, 1e5)
            flyBV.Velocity = Vector3.zero
            flyBV.Parent = hrp
            flyBG = Instance.new("BodyGyro")
            flyBG.MaxTorque = Vector3.new(1e5, 1e5, 1e5)
            flyBG.P = 1e4
            flyBG.Parent = hrp
        end
        local cam = Camera.CFrame
        local dir = Vector3.zero
        if UserInputService:IsKeyDown(Enum.KeyCode.W) then dir = dir + cam.LookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then dir = dir - cam.LookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then dir = dir - cam.RightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then dir = dir + cam.RightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then dir = dir + Vector3.new(0, 1, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then dir = dir - Vector3.new(0, 1, 0) end
        flyBV.Velocity = dir.Magnitude > 0 and dir.Unit * S.FlySpeed or Vector3.zero
        flyBG.CFrame = cam
        hum.PlatformStand = true
    else
        if flyBV then flyBV:Destroy() flyBV = nil end
        if flyBG then flyBG:Destroy() flyBG = nil end
        if hum then hum.PlatformStand = false end
    end
end

local function noclipStep()
    local char = LocalPlayer.Character
    if not char then return end
    for _, part in ipairs(char:GetDescendants()) do
        if part:IsA("BasePart") then
            part.CanCollide = not S.Noclip
        end
    end
end

local function speedStep()
    local hum = getHum(LocalPlayer)
    if hum and S.Speed then
        hum.WalkSpeed = S.WalkSpeed
    end
end

-- ======================== WORLD ========================
local function applyWorld()
    if S.FullBright then
        if not origAmbient then
            origAmbient = Lighting.Ambient
            origBrightness = Lighting.Brightness
        end
        Lighting.Ambient = Color3.new(1, 1, 1)
        Lighting.Brightness = 2
    elseif origAmbient then
        Lighting.Ambient = origAmbient
        Lighting.Brightness = origBrightness or 1
    end
    if S.NoFog then
        if not origFog then origFog = Lighting.FogEnd end
        Lighting.FogEnd = 1e6
    elseif origFog then
        Lighting.FogEnd = origFog
    end
end

-- ======================== INPUT ========================
UserInputService.InputBegan:Connect(function(input, gpe)
    if gpe then return end
    if input.UserInputType == S.AimKey or input.KeyCode == Enum.KeyCode.E then
        HoldingAim = true
    end
    if input.KeyCode == Enum.KeyCode.Space and S.InfiniteJump then
        local hum = getHum(LocalPlayer)
        if hum then
            hum:ChangeState(Enum.HumanoidStateType.Jumping)
        end
    end
end)

UserInputService.InputEnded:Connect(function(input)
    if input.UserInputType == S.AimKey or input.KeyCode == Enum.KeyCode.E then
        HoldingAim = false
    end
end)

-- ======================== FLUENT WINDOW ========================
local Window = Fluent:CreateWindow({
    Title = "ELITE SCRIPTS",
    SubTitle = "Murder Mystery 2",
    TabWidth = 140,
    Size = UDim2.fromOffset(500, 400),
    Acrylic = true,
    Theme = "Darker",
    MinimizeKey = Enum.KeyCode.LeftControl
})

local Tabs = {
    Home      = Window:AddTab({ Title = "Home", Icon = "home" }),
    Combat    = Window:AddTab({ Title = "Combat", Icon = "crosshair" }),
    Visuals   = Window:AddTab({ Title = "Visuals", Icon = "eye" }),
    Farm      = Window:AddTab({ Title = "Farm", Icon = "coins" }),
    Player    = Window:AddTab({ Title = "Player", Icon = "user" }),
    Customize = Window:AddTab({ Title = "Customize", Icon = "palette" }),
    Misc      = Window:AddTab({ Title = "Misc", Icon = "settings" }),
    About     = Window:AddTab({ Title = "About", Icon = "info" }),
}

local Options = Fluent.Options

-- ======================== HOME ========================
do
    Tabs.Home:AddSection("ELITE · MM2")
    Tabs.Home:AddParagraph({
        Title = "ELITE SCRIPTS",
        Content = "Murder Mystery 2 · Fluent UI\nKeyless · UNC · discord.gg/JyHTa3M7h"
    })
    Tabs.Home:AddParagraph({
        Title = "Quick Load",
        Content = "Core toggles. Full controls in other tabs."
    })
    Tabs.Home:AddToggle("HomeESP", {
        Title = "Role ESP",
        Default = true,
        Callback = function(v)
            S.ESP = v
            if Options.ESPEnable then Options.ESPEnable:SetValue(v) end
        end
    })
    Tabs.Home:AddToggle("HomeAim", {
        Title = "Aimbot",
        Default = false,
        Callback = function(v)
            S.Aimbot = v
            if FOVCircle then FOVCircle.Visible = v and S.ShowFOV end
            if Options.AimEnable then Options.AimEnable:SetValue(v) end
        end
    })
    Tabs.Home:AddToggle("HomeAura", {
        Title = "Knife Aura",
        Default = false,
        Callback = function(v)
            S.KnifeAura = v
            if Options.AuraEnable then Options.AuraEnable:SetValue(v) end
        end
    })
    Tabs.Home:AddToggle("HomeFarm", {
        Title = "Auto Farm Coins",
        Default = false,
        Callback = function(v)
            S.AutoFarm = v
            if Options.FarmEnable then Options.FarmEnable:SetValue(v) end
        end
    })
    Tabs.Home:AddToggle("HomeFly", {
        Title = "Fly",
        Default = false,
        Callback = function(v)
            S.Fly = v
            if Options.FlyEnable then Options.FlyEnable:SetValue(v) end
        end
    })
    Tabs.Home:AddButton({
        Title = "Join Discord",
        Description = "discord.gg/JyHTa3M7h",
        Callback = function()
            pcall(function()
                if setclipboard then setclipboard(S.DiscordLink) end
            end)
            Fluent:Notify({ Title = "ELITE SCRIPTS", Content = "Discord link copied", Duration = 3 })
        end
    })
end

-- ======================== COMBAT ========================
do
    Tabs.Combat:AddSection("Aim")
    Tabs.Combat:AddToggle("AimEnable", {
        Title = "Enable Aimbot",
        Default = false,
        Callback = function(v)
            S.Aimbot = v
            if FOVCircle then FOVCircle.Visible = v and S.ShowFOV end
            if Options.HomeAim then Options.HomeAim:SetValue(v) end
        end
    })
    Tabs.Combat:AddToggle("SilentEnable", {
        Title = "Silent Aim",
        Default = false,
        Callback = function(v) S.SilentAim = v end
    })
    Tabs.Combat:AddToggle("AlwaysOn", {
        Title = "Always On",
        Default = false,
        Callback = function(v) S.AlwaysOn = v end
    })
    Tabs.Combat:AddDropdown("TargetRole", {
        Title = "Target Role",
        Values = {"Murderer", "Sheriff", "Any"},
        Default = 1,
        Callback = function(v) S.TargetRole = v end
    })
    Tabs.Combat:AddSlider("FOV", {
        Title = "FOV",
        Default = 130,
        Min = 40,
        Max = 400,
        Rounding = 0,
        Callback = function(v)
            S.FOV = v
            if FOVCircle then FOVCircle.Radius = v end
        end
    })
    Tabs.Combat:AddSlider("Smooth", {
        Title = "Smoothness",
        Default = 0.14,
        Min = 0.01,
        Max = 0.5,
        Rounding = 2,
        Callback = function(v) S.Smoothness = v end
    })
    Tabs.Combat:AddDropdown("AimPart", {
        Title = "Aim Part",
        Values = {"Head", "HumanoidRootPart"},
        Default = 1,
        Callback = function(v) S.AimPart = v end
    })
    Tabs.Combat:AddToggle("ShowFOV", {
        Title = "Show FOV Circle",
        Default = true,
        Callback = function(v)
            S.ShowFOV = v
            if FOVCircle then FOVCircle.Visible = S.Aimbot and v end
        end
    })
    Tabs.Combat:AddToggle("FOVRainbow", {
        Title = "FOV Rainbow",
        Default = false,
        Callback = function(v) S.FOVRainbow = v end
    })

    Tabs.Combat:AddSection("Knife / Gun")
    Tabs.Combat:AddToggle("AuraEnable", {
        Title = "Knife Aura",
        Default = false,
        Callback = function(v)
            S.KnifeAura = v
            if Options.HomeAura then Options.HomeAura:SetValue(v) end
        end
    })
    Tabs.Combat:AddSlider("AuraDist", {
        Title = "Aura Distance",
        Default = 12,
        Min = 5,
        Max = 40,
        Rounding = 0,
        Callback = function(v) S.AuraDist = v end
    })
    Tabs.Combat:AddToggle("AutoStab", {
        Title = "Auto Stab",
        Default = false,
        Callback = function(v) S.AutoStab = v end
    })
    Tabs.Combat:AddToggle("AutoShoot", {
        Title = "Auto Shoot Murderer",
        Default = false,
        Callback = function(v) S.AutoShoot = v end
    })
    Tabs.Combat:AddToggle("KillAll", {
        Title = "Kill All (Aura)",
        Default = false,
        Callback = function(v) S.KillAll = v end
    })
end

-- ======================== VISUALS ========================
do
    Tabs.Visuals:AddSection("Player ESP")
    Tabs.Visuals:AddToggle("ESPEnable", {
        Title = "Enable ESP",
        Default = true,
        Callback = function(v)
            S.ESP = v
            if Options.HomeESP then Options.HomeESP:SetValue(v) end
        end
    })
    Tabs.Visuals:AddToggle("RoleESP", {
        Title = "Show Role Tag",
        Default = true,
        Callback = function(v) S.RoleESP = v end
    })
    Tabs.Visuals:AddToggle("BoxESP", {
        Title = "Box",
        Default = true,
        Callback = function(v) S.Box = v end
    })
    Tabs.Visuals:AddToggle("SkelESP", {
        Title = "Skeleton",
        Default = false,
        Callback = function(v) S.Skeleton = v end
    })
    Tabs.Visuals:AddToggle("TracerESP", {
        Title = "Tracers",
        Default = true,
        Callback = function(v) S.Tracer = v end
    })
    Tabs.Visuals:AddToggle("NameESP", {
        Title = "Name",
        Default = true,
        Callback = function(v) S.Name = v end
    })
    Tabs.Visuals:AddToggle("DistESP", {
        Title = "Distance",
        Default = true,
        Callback = function(v) S.Distance = v end
    })
    Tabs.Visuals:AddToggle("HealthESP", {
        Title = "Health Bar",
        Default = true,
        Callback = function(v) S.Health = v end
    })

    Tabs.Visuals:AddSection("World ESP")
    Tabs.Visuals:AddToggle("CoinESP", {
        Title = "Coin ESP",
        Default = true,
        Callback = function(v) S.CoinESP = v end
    })
    Tabs.Visuals:AddToggle("GunESP", {
        Title = "Gun Drop ESP",
        Default = true,
        Callback = function(v) S.GunESP = v end
    })

    Tabs.Visuals:AddSection("Colors")
    Tabs.Visuals:AddColorpicker("MurdererCol", {
        Title = "Murderer",
        Default = S.MurdererColor,
        Callback = function(v) S.MurdererColor = v end
    })
    Tabs.Visuals:AddColorpicker("SheriffCol", {
        Title = "Sheriff",
        Default = S.SheriffColor,
        Callback = function(v) S.SheriffColor = v end
    })
    Tabs.Visuals:AddColorpicker("InnocentCol", {
        Title = "Innocent",
        Default = S.InnocentColor,
        Callback = function(v) S.InnocentColor = v end
    })
end

-- ======================== FARM ========================
do
    Tabs.Farm:AddSection("Coins")
    Tabs.Farm:AddToggle("FarmEnable", {
        Title = "Auto Farm Coins",
        Default = false,
        Callback = function(v)
            S.AutoFarm = v
            if Options.HomeFarm then Options.HomeFarm:SetValue(v) end
        end
    })
    Tabs.Farm:AddDropdown("FarmMode", {
        Title = "Farm Mode",
        Values = {"Nearest", "Teleport"},
        Default = 1,
        Callback = function(v) S.FarmMode = v end
    })
    Tabs.Farm:AddToggle("AutoGrabGun", {
        Title = "Auto Grab Dropped Gun",
        Default = true,
        Callback = function(v) S.AutoGrabGun = v end
    })
    Tabs.Farm:AddButton({
        Title = "TP to Nearest Coin",
        Callback = function()
            local myHRP = getHRP(LocalPlayer)
            if not myHRP then return end
            local best, bestD = nil, math.huge
            for _, obj in ipairs(Workspace:GetDescendants()) do
                if obj:IsA("BasePart") and string.lower(obj.Name):find("coin") then
                    local d = (obj.Position - myHRP.Position).Magnitude
                    if d < bestD then bestD = d best = obj end
                end
            end
            if best then
                myHRP.CFrame = CFrame.new(best.Position + Vector3.new(0, 3, 0))
            end
        end
    })
    Tabs.Farm:AddButton({
        Title = "TP to Dropped Gun",
        Callback = function()
            local myHRP = getHRP(LocalPlayer)
            if not myHRP then return end
            for _, obj in ipairs(Workspace:GetDescendants()) do
                local n = string.lower(obj.Name)
                if n:find("gun") or n:find("revolver") then
                    local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart")
                    if part then
                        myHRP.CFrame = CFrame.new(part.Position + Vector3.new(0, 3, 0))
                        break
                    end
                end
            end
        end
    })
end

-- ======================== PLAYER ========================
do
    Tabs.Player:AddSection("Movement")
    Tabs.Player:AddToggle("FlyEnable", {
        Title = "Fly",
        Default = false,
        Callback = function(v)
            S.Fly = v
            if Options.HomeFly then Options.HomeFly:SetValue(v) end
        end
    })
    Tabs.Player:AddSlider("FlySpeed", {
        Title = "Fly Speed",
        Default = 70,
        Min = 20,
        Max = 200,
        Rounding = 0,
        Callback = function(v) S.FlySpeed = v end
    })
    Tabs.Player:AddToggle("NoclipEnable", {
        Title = "Noclip",
        Default = false,
        Callback = function(v) S.Noclip = v end
    })
    Tabs.Player:AddToggle("SpeedEnable", {
        Title = "Speed",
        Default = false,
        Callback = function(v) S.Speed = v end
    })
    Tabs.Player:AddSlider("WalkSpeed", {
        Title = "Walk Speed",
        Default = 26,
        Min = 16,
        Max = 100,
        Rounding = 0,
        Callback = function(v) S.WalkSpeed = v end
    })
    Tabs.Player:AddToggle("InfJump", {
        Title = "Infinite Jump",
        Default = false,
        Callback = function(v) S.InfiniteJump = v end
    })

    Tabs.Player:AddSection("Teleport")
    Tabs.Player:AddButton({
        Title = "TP to Murderer",
        Callback = function()
            local myHRP = getHRP(LocalPlayer)
            if not myHRP then return end
            for _, plr in ipairs(Players:GetPlayers()) do
                if plr ~= LocalPlayer and getRole(plr) == "Murderer" and isAlive(plr) then
                    local hrp = getHRP(plr)
                    if hrp then
                        myHRP.CFrame = hrp.CFrame * CFrame.new(0, 0, 3)
                        break
                    end
                end
            end
        end
    })
    Tabs.Player:AddButton({
        Title = "TP to Sheriff",
        Callback = function()
            local myHRP = getHRP(LocalPlayer)
            if not myHRP then return end
            for _, plr in ipairs(Players:GetPlayers()) do
                if plr ~= LocalPlayer and getRole(plr) == "Sheriff" and isAlive(plr) then
                    local hrp = getHRP(plr)
                    if hrp then
                        myHRP.CFrame = hrp.CFrame * CFrame.new(0, 0, 3)
                        break
                    end
                end
            end
        end
    })
end

-- ======================== CUSTOMIZE ========================
do
    Tabs.Customize:AddSection("Theme")
    Tabs.Customize:AddDropdown("ThemeSelect", {
        Title = "Theme Preset",
        Values = {"Dark", "Darker", "Amethyst", "Aqua", "Rose", "Light"},
        Default = 2,
        Callback = function(v)
            S.ThemeName = v
            pcall(function() Fluent:SetTheme(v) end)
        end
    })
    Tabs.Customize:AddColorpicker("AccentPick", {
        Title = "Accent Color",
        Default = S.AccentColor,
        Callback = function(v)
            S.AccentColor = v
            S.FOVColor = v
            S.DiscordLEDColor = v
            if FOVCircle then FOVCircle.Color = v end
            if DiscordLEDText then DiscordLEDText.Color = v end
            if DiscordLEDGlow then DiscordLEDGlow.Color = v end
            if DiscordLEDLine then DiscordLEDLine.Color = v end
        end
    })
    Tabs.Customize:AddColorpicker("FOVColorPick", {
        Title = "FOV Circle Color",
        Default = S.FOVColor,
        Callback = function(v)
            S.FOVColor = v
            if FOVCircle then FOVCircle.Color = v end
        end
    })
    Tabs.Customize:AddToggle("DiscordLEDToggle", {
        Title = "Discord LED",
        Default = true,
        Callback = function(v)
            S.DiscordLED = v
            if DiscordLEDText then DiscordLEDText.Visible = v end
            if DiscordLEDGlow then DiscordLEDGlow.Visible = v end
            if DiscordLEDLine then DiscordLEDLine.Visible = v end
        end
    })
    Tabs.Customize:AddColorpicker("LEDColor", {
        Title = "LED Color",
        Default = S.DiscordLEDColor,
        Callback = function(v)
            S.DiscordLEDColor = v
            if DiscordLEDText then DiscordLEDText.Color = v end
            if DiscordLEDGlow then DiscordLEDGlow.Color = v end
            if DiscordLEDLine then DiscordLEDLine.Color = v end
        end
    })
    Tabs.Customize:AddParagraph({
        Title = "Note",
        Content = "Accent updates FOV + LED live. Theme presets reload Fluent colors."
    })
end

-- ======================== MISC ========================
do
    Tabs.Misc:AddSection("World")
    Tabs.Misc:AddToggle("FullBright", {
        Title = "Full Bright",
        Default = false,
        Callback = function(v)
            S.FullBright = v
            applyWorld()
        end
    })
    Tabs.Misc:AddToggle("NoFog", {
        Title = "No Fog",
        Default = false,
        Callback = function(v)
            S.NoFog = v
            applyWorld()
        end
    })
    Tabs.Misc:AddSection("Config")
    Tabs.Misc:AddButton({
        Title = "Copy Discord Link",
        Callback = function()
            pcall(function() if setclipboard then setclipboard(S.DiscordLink) end end)
            Fluent:Notify({ Title = "ELITE", Content = "Copied discord.gg/JyHTa3M7h", Duration = 2 })
        end
    })
end

-- ======================== ABOUT ========================
do
    Tabs.About:AddParagraph({
        Title = "ELITE SCRIPTS",
        Content = "Murder Mystery 2 build\nFluent UI · compact dense layout\nKeyless · UNC universal"
    })
    Tabs.About:AddParagraph({
        Title = "Features",
        Content = "Role ESP · Coin/Gun ESP · Aimbot/Silent\nKnife Aura · Auto Farm · Auto Shoot\nFly/Noclip/Speed · Full Customize"
    })
    Tabs.About:AddParagraph({
        Title = "Discord",
        Content = "discord.gg/JyHTa3M7h"
    })
    Tabs.About:AddButton({
        Title = "Join Discord",
        Callback = function()
            pcall(function() if setclipboard then setclipboard(S.DiscordLink) end end)
            Fluent:Notify({ Title = "ELITE SCRIPTS", Content = "Link copied", Duration = 2 })
        end
    })
end

-- Managers
SaveManager:SetLibrary(Fluent)
InterfaceManager:SetLibrary(Fluent)
SaveManager:IgnoreThemeSettings()
InterfaceManager:SetFolder("ELITE_MM2")
SaveManager:SetFolder("ELITE_MM2")
InterfaceManager:BuildInterfaceSection(Tabs.Misc)
SaveManager:BuildConfigSection(Tabs.Misc)

Window:SelectTab(1)

Fluent:Notify({
    Title = "ELITE SCRIPTS",
    Content = "Murder Mystery 2 loaded",
    Duration = 4
})

-- ======================== MAIN LOOP ========================
RunService.RenderStepped:Connect(function()
    -- FOV
    if FOVCircle then
        FOVCircle.Position = Vector2.new(Mouse.X, Mouse.Y)
        FOVCircle.Radius = S.FOV
        if S.FOVRainbow then
            local h = (tick() * 0.4) % 1
            FOVCircle.Color = Color3.fromHSV(h, 0.85, 1)
        else
            FOVCircle.Color = S.FOVColor
        end
        FOVCircle.Visible = S.Aimbot and S.ShowFOV
    end

    -- Aim
    local target = getClosestInFOV(S.TargetRole)
    if S.Aimbot and (HoldingAim or S.AlwaysOn) and target then
        aimAt(target)
    elseif S.SilentAim and target then
        aimAt(target)
    end

    knifeAuraStep()
    autoShootStep()
    farmStep()
    updatePlayerESP()
    updateWorldESP()
    flyStep()
    noclipStep()
    speedStep()

    -- Discord LED
    if S.DiscordLED and DiscordLEDText then
        local vs = Camera.ViewportSize
        local y, x = vs.Y - 18, vs.X / 2
        DiscordLEDText.Position = Vector2.new(x, y)
        if DiscordLEDGlow then
            DiscordLEDGlow.Position = Vector2.new(x, y)
            DiscordLEDGlow.Color = S.DiscordLEDColor
        end
        DiscordLEDText.Color = S.DiscordLEDColor
        if DiscordLEDLine then
            DiscordLEDLine.From = Vector2.new(x - 70, y - 10)
            DiscordLEDLine.To = Vector2.new(x + 70, y - 10)
            DiscordLEDLine.Color = S.DiscordLEDColor
        end
    end
end)

Players.PlayerRemoving:Connect(function(plr)
    clearESP(plr)
    roleCache[plr] = nil
end)

pcall(function() SaveManager:LoadAutoloadConfig() end)

print("[ELITE SCRIPTS] Murder Mystery 2 loaded — Home tab active")
36

🔫 NonSense Hub | MURDER MYSTERY 2 AUTO FARM COINS ⚔️

keyless working MURDER MYSTERY 2 AUTO FARM COINS ⚔️

Best Murder Mystery 2 Script! Includes features like AutoFarm Coins, Auto XP, Fling Murder, Sheriff, innocents. Silent Aim + SO MUCH MORE!

loadstring(game:HttpGet("https://nsense.fun/scripts/loader.lua", true))()
nsense.fun updated 2 Nov 2026 372 views 0 loader source ↗
38

MM2 HUB [OPEN SOURCE]

keyless working mobile

Join my Discord for updates and support: https://discord.gg/2ksQSAnnW6Combat:Aim lock (smooth, adjustable FOV, head/torso)Trigger bot and auto fireSilent aim (redirects your shots to the murderer)Auto kill murderer through wallsAuto knife throwKill everyone (5s knife aura)Visuals / ESPRole ESP with custom colors for ev

loadstring(game:HttpGet('https://raw.githubusercontent.com/akiradv/scriptsroblox/refs/heads/main/loader.lua'))()
raw.githubusercontent.com updated 2 Nov 2026 56 views 0 loader source ↗

How to run these Murder Mystery 2 scripts

  1. 1. Install an executor from the executor list. Delta or Xeno on mobile, Swift or Wave on PC.
  2. 2. Join Murder Mystery 2 and wait until you are fully loaded into the server.
  3. 3. Attach the executor, paste one loader above, press Execute.
  4. 4. The in-game menu opens — usually on the left edge or under a small circle. Toggle features there.

If a script does nothing, the game updated and the loader broke. Try the next one down — the list is sorted by useful votes, so the top entries are the ones that keep getting updated.

Murder Mystery 2 — questions

?Can other players tell I am using ESP?

Not from behaviour alone in a normal round. It becomes obvious if you walk straight at the murderer through a wall — break line of sight occasionally.

?Does silent aim work on the murderer's knife throw?

Only on hitscan shots. Knife throws are projectile, so you still lead the target yourself; the aim assist helps with the sheriff's revolver.

?Why do MM2 scripts break so fast?

MM2 is old and frequently re-obfuscated, so remote names move. Anything past a week old here is suspect — sort by date, not by votes, when the game just updated.

Other games

All 10 games with scripts · 387 loaders indexed