Bankroll Open Source
Key Required

Bankroll Open Source

[NEW MAP] BloxStrikeLuaFolloLuaFollo 3.5K views 511 executesUpdated Apr 25, 2026
5.0/ 5(2 votes)
20100% Positive
Lua Script•4153 lines (163606 chars)
local genv = getgenv()
local _ = genv.debug
local _ = genv.debug
local _ = genv.debug


print(loadstring)
print(getgenv().loadstring)

loadstring([=[
local allowedPlaces = {114234929420007, 108194354348181, 135434213652028}
if not table.find(allowedPlaces, game.PlaceId) then 
    game:GetService("Players").LocalPlayer:Kick("wrong game, the game to execute this script it's bloxstrike")
    return 
end
game:GetService("StarterGui"):SetCore("SendNotification", {Title = "Cracked By FolloHub", Text = "discord.gg/cXwvDJvY7x", Duration = 10})
local Beta = false
local BetaKey = "bankroll_beta"
local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")
local Players = game:GetService("Players")
local TS = game:GetService("TweenService")
local RepStore = game:GetService("ReplicatedStorage")
local HS = game:GetService("HttpService")
local LP = Players.LocalPlayer
local _rid = HS:GenerateGUID(false)
local _st = tick()
if getgenv().BankrollCleanup then 
    getgenv().BankrollCleanup() 
end

local Conn, Drws = {}, {}

local function AC(c) 
    if c then 
        Conn[#Conn + 1] = c 
    end 
end

local function AD(d) 
    if d and type(d) ~= "number" then 
        Drws[#Drws + 1] = d 
    end 
end

local function Safe(f) 
    return function(...) 
        pcall(f, ...) 
    end 
end

local WorldESP = {DroppedWeapons = {}, Bomb = nil, Molotovs = {}, Smokes = {}}

local function DestroyWESP(e)
    if not e then return end
    for _, d in pairs(e.Box or {}) do 
        if d and type(d) ~= "number" then 
            pcall(d.Remove, d) 
        end 
    end
    if e.Name and type(e.Name) ~= "number" then 
        pcall(e.Name.Remove, e.Name) 
    end
    if e.HL then 
        pcall(e.HL.Destroy, e.HL) 
    end
    if e.Radius and type(e.Radius) ~= "number" then 
        pcall(e.Radius.Remove, e.Radius) 
    end
end

getgenv().BankrollCleanup = function()
    for _, c in pairs(Conn) do 
        pcall(function() c:Disconnect() end) 
    end
    for _, d in pairs(Drws) do 
        pcall(function() if type(d) ~= "number" then d:Remove() end end) 
    end
    table.clear(Conn)
    table.clear(Drws)

    pcall(function() 
        if game:GetService("CoreGui"):FindFirstChild("BankrollUI") then 
            game:GetService("CoreGui").BankrollUI:Destroy() 
        end 
    end)
    pcall(function() 
        if game:GetService("CoreGui"):FindFirstChild("ESP_Highlight_Container") then 
            game:GetService("CoreGui").ESP_Highlight_Container:Destroy() 
        end 
    end)
    pcall(function() 
        if game:GetService("CoreGui"):FindFirstChild("Charms_Container") then 
            game:GetService("CoreGui").Charms_Container:Destroy() 
        end 
    end)

    for _, eo in pairs(WorldESP.DroppedWeapons) do 
        DestroyWESP(eo) 
    end
    if WorldESP.Bomb then 
        DestroyWESP(WorldESP.Bomb) 
    end
    for _, eo in pairs(WorldESP.Molotovs) do 
        DestroyWESP(eo) 
    end
    for _, eo in pairs(WorldESP.Smokes) do 
        DestroyWESP(eo) 
    end

    table.clear(WorldESP.DroppedWeapons)
    WorldESP.Bomb = nil
    table.clear(WorldESP.Molotovs)
    table.clear(WorldESP.Smokes)

    pcall(function() 
        if workspace:FindFirstChild("_BankrollActors") then 
            workspace._BankrollActors:Destroy() 
        end 
    end)
end

local G = {
    mousemoverel = mousemoverel or (mousemove and function(x, y) mousemove(x, y) end) or function() end,
    mouse1click = mouse1click or mouse_click or function() end,
    C3W = Color3.new(1, 1, 1),
    C3B = Color3.new(0, 0, 0),
    LastCharmVisCheck = 0,
    LastCharmScan = 0,
    LastCharmUpdate = 0,
    FrameCount = 0,
    lastFPSUpdate = tick(),
    LastESPUpdate = 0,
    LastGraphUpdate = 0,
    LastMovementUpdate = 0,
    lastTriggerTime = 0,
    LocalCharacter = nil,
    AimbotActive = false,
    TriggerbotActive = false,
    knifeChangerSupported = true,
    executor = (identifyexecutor and identifyexecutor()) or "Unknown",
    hasFileSystem = false,
    inspectWarningShown = false,
    LastMouseReleaseTime = 0,
    JumpBugActive = false,
    EdgeBugToggleActive = false
}

pcall(function() 
    if writefile and readfile then 
        G.hasFileSystem = true 
    end 
end)

local function SafeRequire(module)
    if not module then return nil end
    local success, result = pcall(function() return require(module) end)
    if success and result and type(result) == "table" then 
        return result 
    end
    return nil
end

local JB_VERT_BOOST = 3
local JB_HORIZ_BOOST = 2
local JB_MIN_FRAMES = 3

local jbebRP = RaycastParams.new()
jbebRP.FilterType = Enum.RaycastFilterType.Exclude
jbebRP.IgnoreWater = true
jbebRP.RespectCanCollide = true

local EB_Active = false
local JBEB_LastChar = nil
local JBActive = false
local JBCooldown = 0
local JBEB_FallFrames = 0
local JBEB_VelBuffer = {}
local JBEB_BufferSize = 15
local JBEB_WasAir = true
local JBEB_LandedFrame = false
local jbFlashTime = 0
local ebFlashTime = 0

local GndOffsets = {
    Vector3.new(0, 0, 0),
    Vector3.new(0.8, 0, 0),
    Vector3.new(-0.8, 0, 0),
    Vector3.new(0, 0, 0.8),
    Vector3.new(0, 0, -0.8)
}

local function JBEB_SetFilter(c)
    if c == JBEB_LastChar then return end
    JBEB_LastChar = c
    jbebRP.FilterDescendantsInstances = {c, workspace.CurrentCamera}
end

local function JBEB_GameGroundCheck(pos)
    for _, off in ipairs(GndOffsets) do
        local r = workspace:Raycast(pos + off, Vector3.new(0, -3.1, 0), jbebRP)
        if r and r.Normal.Y > 0.7 and r.Instance.CanCollide then 
            return true 
        end
    end
    return false
end

local function JBEB_IsNearEdge(pos)
    local center = workspace:Raycast(pos, Vector3.new(0, -3.5, 0), jbebRP)
    if center and center.Normal.Y > 0.7 then return false end

    local sideHits = 0
    local sideOffsets = {
        Vector3.new(2, 0, 0), Vector3.new(-2, 0, 0),
        Vector3.new(0, 0, 2), Vector3.new(0, 0, -2),
        Vector3.new(1.5, 0, 1.5), Vector3.new(-1.5, 0, 1.5),
        Vector3.new(1.5, 0, -1.5), Vector3.new(-1.5, 0, -1.5)
    }
    for _, off in ipairs(sideOffsets) do
        local r = workspace:Raycast(pos + off, Vector3.new(0, -5, 0), jbebRP)
        if r and r.Normal.Y > 0.7 then 
            sideHits = sideHits + 1 
        end
    end
    if sideHits >= 2 then return true end

    local wallDirs = {Vector3.new(2, 0, 0), Vector3.new(-2, 0, 0), Vector3.new(0, 0, 2), Vector3.new(0, 0, -2)}
    for yOff = 0, -3, -1 do
        for _, dir in ipairs(wallDirs) do
            local r = workspace:Raycast(pos + Vector3.new(0, yOff, 0), dir, jbebRP)
            if r and (pos + Vector3.new(0, yOff, 0) - r.Position).Magnitude < 2 then 
                return true 
            end
        end
    end
    return false
end

local function JBEB_StillOnEdge(pos)
    local center = workspace:Raycast(pos, Vector3.new(0, -3.5, 0), jbebRP)
    if center and center.Normal.Y > 0.7 then return false end

    for _, off in ipairs({Vector3.new(1.5, 0, 0), Vector3.new(-1.5, 0, 0), Vector3.new(0, 0, 1.5), Vector3.new(0, 0, -1.5)}) do
        local r = workspace:Raycast(pos + off, Vector3.new(0, -5, 0), jbebRP)
        if r then return true end
    end

    for _, dir in ipairs({Vector3.new(2, 0, 0), Vector3.new(-2, 0, 0), Vector3.new(0, 0, 2), Vector3.new(0, 0, -2)}) do
        local r = workspace:Raycast(pos, dir, jbebRP)
        if r and (pos - r.Position).Magnitude < 2 then return true end
    end
    return false
end

local JBEB_IndicatorGui = nil
local JBEB_JBLabel = nil
local JBEB_EBLabel = nil

local SD = {SkinsRoot = nil, SkinSelections = {}, GloveSelections = {}, GloveFolders = {}}

pcall(function()
    SD.SkinsRoot = RepStore:FindFirstChild("Assets") and RepStore.Assets:FindFirstChild("Skins")
end)

if SD.SkinsRoot then
    pcall(function()
        for _, wf in ipairs(SD.SkinsRoot:GetChildren()) do
            local skins = {}
            for _, sf in ipairs(wf:GetChildren()) do 
                skins[#skins + 1] = sf.Name 
            end
            table.sort(skins)
            SD.SkinSelections[wf.Name] = skins
        end

        for _, folder in ipairs(SD.SkinsRoot:GetChildren()) do
            if (folder.Name:match("Glove") or folder.Name:match("Gloves") or folder.Name == "Hand Wraps") 
               and not (folder.Name:match("T Glove") or folder.Name:match("CT Glove") or folder.Name:match("T Gloves") or folder.Name:match("CT Gloves")) then
                SD.GloveFolders[#SD.GloveFolders + 1] = folder
            end
        end
    end)
end

for _, gf in ipairs(SD.GloveFolders) do
    local skins = {"Default"}
    for _, skin in ipairs(gf:GetChildren()) do 
        skins[#skins + 1] = skin.Name 
    end
    SD.GloveSelections[gf.Name] = skins
end

if string.find(G.executor, "RonixExploit", 1, true) or string.find(G.executor, "Xeno", 1, true) or string.find(G.executor, "Solara", 1, true) then 
    G.knifeChangerSupported = false 
end

if not RepStore:FindFirstChild("database") then 
    local db = Instance.new("Folder")
    db.Name = "database"
    db.Parent = RepStore 
end

local function RunOnActor(func)
    local success = false
    pcall(function()
        if not workspace:FindFirstChild("_BankrollActors") then 
            local af = Instance.new("Folder")
            af.Name = "_BankrollActors"
            af.Parent = workspace 
        end
        task.defer(func)
        success = true
    end)
    if not success then 
        pcall(func) 
    end
end

local function PlayIntro()
    local IG = Instance.new("ScreenGui")
    IG.IgnoreGuiInset = true
    IG.Parent = game:GetService("CoreGui")

    local IB = Instance.new("Frame", IG)
    IB.Size = UDim2.new(1, 0, 1, 0)
    IB.BackgroundTransparency = 1
    IB.BorderSizePixel = 0

    local IC = Instance.new("Frame", IB)
    IC.Size = UDim2.new(0, 400, 0, 70)
    IC.Position = UDim2.new(0.5, 0, 0.5, 0)
    IC.AnchorPoint = Vector2.new(0.5, 0.5)
    IC.BackgroundTransparency = 1

    local LB = Instance.new("TextLabel", IC)
    LB.Text = "B"
    LB.Font = Enum.Font.GothamBlack
    LB.TextSize = 80
    LB.TextColor3 = Color3.fromRGB(255, 60, 160)
    LB.Size = UDim2.new(0.15, 0, 1, 0)
    LB.BackgroundTransparency = 1
    LB.TextTransparency = 1
    LB.AnchorPoint = Vector2.new(0.5, 0.5)
    LB.Position = UDim2.new(0.5, 0, 0.5, 0)

    local LR = Instance.new("TextLabel", IC)
    LR.Text = "ANKROLL"
    LR.Font = Enum.Font.GothamBlack
    LR.TextSize = 80
    LR.TextColor3 = Color3.fromRGB(255, 60, 160)
    LR.Size = UDim2.new(0.85, 0, 1, 0)
    LR.Position = UDim2.new(0.13, 0, 0, 0)
    LR.BackgroundTransparency = 1
    LR.TextTransparency = 1
    LR.TextXAlignment = Enum.TextXAlignment.Left

    TS:Create(LB, TweenInfo.new(1), {TextTransparency = 0}):Play()
    task.wait(1.5)
    TS:Create(LB, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = UDim2.new(0.075, 0, 0.5, 0)}):Play()
    task.wait(0.8)
    TS:Create(LR, TweenInfo.new(1), {TextTransparency = 0}):Play()
    task.wait(2.5)

    local fi = TweenInfo.new(1)
    TS:Create(LB, fi, {TextTransparency = 1}):Play()
    TS:Create(LR, fi, {TextTransparency = 1}):Play()
    task.wait(1)
    IG:Destroy()
end

PlayIntro()

local function GetUIParent() 
    if gethui then return gethui() end 
    return game:GetService("CoreGui") 
end

local Parent = GetUIParent()

for _, child in pairs(Parent:GetChildren()) do 
    if child.Name == "BankrollUI" then 
        child:Destroy() 
    end 
end

pcall(function() 
    if game:GetService("CoreGui"):FindFirstChild("ESP_Highlight_Container") then 
        game:GetService("CoreGui").ESP_Highlight_Container:Destroy() 
    end 
end)

local UI = Instance.new("ScreenGui")
UI.Name = "BankrollUI"
UI.IgnoreGuiInset = true
UI.Parent = Parent
UI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

local Themes = {
    Default = {Main = Color3.fromRGB(20, 20, 20), Item = Color3.fromRGB(30, 30, 30), Outline = Color3.fromRGB(60, 60, 60), Accent = Color3.fromRGB(255, 105, 180), Text = Color3.fromRGB(255, 255, 255), TextDim = Color3.fromRGB(150, 150, 150), TextStroke = Color3.fromRGB(0, 0, 0)},
    Dark = {Main = Color3.fromRGB(15, 15, 15), Item = Color3.fromRGB(25, 25, 25), Outline = Color3.fromRGB(40, 40, 40), Accent = Color3.fromRGB(100, 100, 255), Text = Color3.fromRGB(240, 240, 240), TextDim = Color3.fromRGB(140, 140, 140), TextStroke = Color3.fromRGB(0, 0, 0)},
    Light = {Main = Color3.fromRGB(240, 240, 240), Item = Color3.fromRGB(225, 225, 225), Outline = Color3.fromRGB(150, 150, 150), Accent = Color3.fromRGB(0, 140, 255), Text = Color3.fromRGB(255, 255, 255), TextDim = Color3.fromRGB(180, 180, 180), TextStroke = Color3.fromRGB(0, 0, 0)},
    Blood = {Main = Color3.fromRGB(20, 10, 10), Item = Color3.fromRGB(30, 15, 15), Outline = Color3.fromRGB(60, 30, 30), Accent = Color3.fromRGB(220, 40, 40), Text = Color3.fromRGB(255, 200, 200), TextDim = Color3.fromRGB(150, 100, 100), TextStroke = Color3.fromRGB(20, 0, 0)},
    Ocean = {Main = Color3.fromRGB(10, 20, 30), Item = Color3.fromRGB(15, 30, 45), Outline = Color3.fromRGB(30, 60, 90), Accent = Color3.fromRGB(0, 190, 255), Text = Color3.fromRGB(200, 240, 255), TextDim = Color3.fromRGB(100, 140, 160), TextStroke = Color3.fromRGB(0, 10, 20)},
    Forest = {Main = Color3.fromRGB(20, 30, 20), Item = Color3.fromRGB(30, 45, 30), Outline = Color3.fromRGB(50, 80, 50), Accent = Color3.fromRGB(100, 200, 100), Text = Color3.fromRGB(220, 255, 220), TextDim = Color3.fromRGB(120, 160, 120), TextStroke = Color3.fromRGB(10, 20, 10)},
    Midnight = {Main = Color3.fromRGB(15, 15, 30), Item = Color3.fromRGB(25, 25, 45), Outline = Color3.fromRGB(40, 40, 70), Accent = Color3.fromRGB(100, 100, 200), Text = Color3.fromRGB(220, 220, 255), TextDim = Color3.fromRGB(120, 120, 160), TextStroke = Color3.fromRGB(10, 10, 20)},
    Sunset = {Main = Color3.fromRGB(30, 20, 20), Item = Color3.fromRGB(45, 30, 30), Outline = Color3.fromRGB(80, 50, 50), Accent = Color3.fromRGB(255, 150, 50), Text = Color3.fromRGB(255, 230, 220), TextDim = Color3.fromRGB(180, 140, 130), TextStroke = Color3.fromRGB(20, 10, 10)}
}

local CurrentTheme = Themes.Default
local ThemeRegistry = {}

local function AddThemeObject(obj, tt)
    if not obj then return end
    if not ThemeRegistry[tt] then ThemeRegistry[tt] = {} end
    ThemeRegistry[tt][#ThemeRegistry[tt] + 1] = obj

    pcall(function()
        if tt == "Main" then obj.BackgroundColor3 = CurrentTheme.Main
        elseif tt == "Item" then obj.BackgroundColor3 = CurrentTheme.Item
        elseif tt == "Outline" then 
            if obj:IsA("UIStroke") then obj.Color = CurrentTheme.Outline 
            elseif obj:IsA("Frame") or obj:IsA("ScrollingFrame") then obj.BorderColor3 = CurrentTheme.Outline end
        elseif tt == "Accent" then 
            if obj:IsA("TextLabel") or obj:IsA("TextButton") then obj.TextColor3 = CurrentTheme.Accent 
            else obj.BackgroundColor3 = CurrentTheme.Accent end
        elseif tt == "Text" then 
            obj.TextColor3 = CurrentTheme.Text
            if obj:IsA("TextLabel") or obj:IsA("TextButton") then 
                obj.TextStrokeTransparency = 0
                obj.TextStrokeColor3 = CurrentTheme.TextStroke 
            end
        elseif tt == "TextDim" then obj.TextColor3 = CurrentTheme.TextDim end
    end)
end

local function CleanThemeRegistry()
    for tt, objs in pairs(ThemeRegistry) do
        local c = {}
        for _, o in pairs(objs) do
            local a = false
            pcall(function() a = (o.Parent ~= nil) or (o.Visible ~= nil) end)
            if a then c[#c + 1] = o end
        end
        ThemeRegistry[tt] = c
    end
end

local function RefreshTheme()
    for tt, objs in pairs(ThemeRegistry) do
        for _, o in pairs(objs) do
            pcall(function()
                if tt == "Main" then o.BackgroundColor3 = CurrentTheme.Main
                elseif tt == "Item" then o.BackgroundColor3 = CurrentTheme.Item
                elseif tt == "Outline" then 
                    if o:IsA("UIStroke") then o.Color = CurrentTheme.Outline 
                    elseif o:IsA("Frame") or o:IsA("ScrollingFrame") then o.BorderColor3 = CurrentTheme.Outline end
                elseif tt == "Accent" then 
                    if o:IsA("TextLabel") or o:IsA("TextButton") then o.TextColor3 = CurrentTheme.Accent 
                    else o.BackgroundColor3 = CurrentTheme.Accent end
                elseif tt == "Text" then 
                    o.TextColor3 = CurrentTheme.Text
                    if o:IsA("TextLabel") or o:IsA("TextButton") then 
                        o.TextStrokeTransparency = 0
                        o.TextStrokeColor3 = CurrentTheme.TextStroke 
                    end
                elseif tt == "TextDim" then o.TextColor3 = CurrentTheme.TextDim end
            end)
        end
    end
    CleanThemeRegistry()
end

local function DeepCopy(orig)
    local c = {}
    for k, v in pairs(orig) do
        if type(v) == "table" then v = DeepCopy(v) end
        c[k] = v
    end
    return c
end

local SecondaryWeapons = {["USP-S"] = true, ["Glock-18"] = true, ["P250"] = true, ["Five-SeveN"] = true, ["Tec-9"] = true, ["Dual Berettas"] = true, ["Deagle"] = true, ["R8 Revolver"] = true, ["CZ75-Auto"] = true, ["P2000"] = true}
local ScopedWeapons = {["AWP"] = true, ["SSG 08"] = true, ["G3SG1"] = true, ["SCAR-20"] = true, ["AUG"] = true, ["SG 553"] = true}

local Camera = workspace.CurrentCamera

local Config = {
    Aimbot = {Enabled = false, TeamCheck = true, AliveCheck = true, FOV = 50, Smoothness = 4, TargetPart = "Head", WallCheck = true, HoldKey = Enum.KeyCode.LeftAlt, DrawFOV = true, Mode = "Hold"},
    AntiAim = {Enabled = false, YawOffset = 180, JitterRange = 35},
    Triggerbot = {Enabled = false, HoldKey = Enum.KeyCode.E, Delay = 0.05, TeamCheck = true, Mode = "Hold"},
    ESP = {
        Enabled = false, Box = false, BoxOutline = false, BoxThickness = 1,
        BoxFill = false, BoxFillColor1 = Color3.fromRGB(255, 0, 0), BoxFillColor2 = Color3.fromRGB(0, 0, 255), BoxFillTransparency = 0.8, BoxFillFadeSpeed = 3,
        Name = false, NameSize = 13, Health = false, Skeleton = false, SkeletonThickness = 2,
        HeadDot = false, Highlight = false, Distance = false, TeamCheck = true, VisibilityCheck = false, MaxDistance = 2000,
        BoxColor = Color3.fromRGB(255, 255, 255), BoxVisibleColor = Color3.fromRGB(0, 255, 0), BoxNotVisibleColor = Color3.fromRGB(255, 0, 0),
        NameColor = Color3.fromRGB(255, 255, 255), NameVisibleColor = Color3.fromRGB(0, 255, 0), NameNotVisibleColor = Color3.fromRGB(255, 0, 0),
        SkeletonColor = Color3.fromRGB(255, 255, 255), SkeletonVisibleColor = Color3.fromRGB(0, 255, 0), SkeletonNotVisibleColor = Color3.fromRGB(255, 0, 0),
        HeadDotColor = Color3.fromRGB(255, 255, 255), HeadDotVisibleColor = Color3.fromRGB(0, 255, 0), HeadDotNotVisibleColor = Color3.fromRGB(255, 0, 0),
        HighlightFill = Color3.fromRGB(255, 0, 0), HighlightOutline = Color3.fromRGB(255, 255, 255),
        HighlightVisibleFill = Color3.fromRGB(0, 255, 0), HighlightHiddenFill = Color3.fromRGB(255, 0, 0),
        DistanceColor = Color3.fromRGB(255, 255, 255),
        HealthBarCustom = false, HealthBarColor = Color3.fromRGB(0, 255, 0),
        CurrentWeapon = {Enabled = false, Color = Color3.fromRGB(255, 255, 255)},
        Bomb = {Enabled = false, Box = true, Highlight = true, Name = true, Color = Color3.fromRGB(255, 0, 0)},
        DroppedWeapons = {Enabled = false, Box = true, Highlight = true, Name = true, Color = Color3.fromRGB(255, 255, 255)},
        Molotovs = {Enabled = false, Highlight = true, Color = Color3.fromRGB(255, 165, 0)},
        Smokes = {Enabled = false, Highlight = true, Color = Color3.fromRGB(200, 200, 200)}
    },
    Charms = {Enabled = false, TeamCheck = true, VisibleColor = Color3.fromRGB(255, 0, 0), HiddenColor = Color3.fromRGB(255, 255, 255), Transparency = 0.5, AlwaysOnTop = true},
    SkinChanger = {Enabled = false, Skins = {}},
    KnifeChanger = {Enabled = false, Model = "Karambit"},
    GloveChanger = {Enabled = false, Gloves = {}, Model = "Sports Gloves", Skin = "Default"},
    Graph = {Enabled = false, Color = Color3.fromRGB(255, 255, 255), MaxSpeed = 50, PeakEnabled = false},
    MovementDisplay = {Enabled = false, Color = Color3.fromRGB(255, 255, 255)},
    AutoBhop = false,
    BhopKey = Enum.KeyCode.Space,
    JumpBug = {Enabled = false, Power = 1.0, Mode = "Always", Key = Enum.KeyCode.V},
    EdgeBug = {Enabled = false, MaxDuration = 2.0, Range = 8, Mode = "Always", Key = Enum.KeyCode.B},
    JBEBIndicator = true,
    JBColor = Color3.fromRGB(255, 255, 255),
    EBColor = Color3.fromRGB(255, 255, 255),
    Watermark = true,
    ShowKeybinds = true,
    Debug = false,
    SpectatorList = false,
    FlashRemover = false,
    SmokeRemover = false,
    Theme = "Default"
}

local DefaultConfig = DeepCopy(Config)

local ESP_ = {Players = {}}
local CharmCache = {}
local CharmVisCache = {}

for w, s in pairs(SD.SkinSelections) do 
    Config.SkinChanger.Skins[w] = s[1] or "Default" 
end
for _, gf in ipairs(SD.GloveFolders) do 
    Config.GloveChanger.Gloves[gf.Name] = "Default" 
end

local function is_enemy(plr)
    if plr == Players.LocalPlayer then return false end
    if plr.Team and Players.LocalPlayer.Team then return plr.Team ~= Players.LocalPlayer.Team end
    local mc = Players.LocalPlayer.Character
    local tc = plr.Character
    if not mc or not tc or not mc.Parent or not tc.Parent then return false end
    return mc.Parent.Name ~= tc.Parent.Name
end

local Checkifbaseknife = {"CT Knife", "T Knife", "Knife"}
local function Checkknife(w)
    if not w then return false end
    for _, k in ipairs(Checkifbaseknife) do
        if w == k then return true end
    end
    return false
end

local function MakeDraggable(obj, dh)
    local handle = dh or obj
    handle.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            local ds = input.Position
            local sp = obj.Position
            local ic, ie
            ic = UIS.InputChanged:Connect(function(mi)
                if mi.UserInputType == Enum.UserInputType.MouseMovement then
                    local d = mi.Position - ds
                    obj.Position = UDim2.new(sp.X.Scale, sp.X.Offset + d.X, sp.Y.Scale, sp.Y.Offset + d.Y)
                end
            end)
            ie = input.Changed:Connect(function()
                if input.UserInputState == Enum.UserInputState.End then
                    if ic then ic:Disconnect() end
                    if ie then ie:Disconnect() end
                end
            end)
        end
    end)
end

local function IsHoldKeyDown(key)
    if not key then return false end
    if typeof(key) == "EnumItem" then
        if key.EnumType == Enum.KeyCode then return UIS:IsKeyDown(key)
        elseif key.EnumType == Enum.UserInputType then return UIS:IsMouseButtonPressed(key) end
    end
    return false
end

local function IsJBEBActive(config)
    if config.Mode == "Always" then
        return config.Enabled
    elseif config.Mode == "Toggle" then
        if config == Config.JumpBug then
            return config.Enabled and G.JumpBugActive
        else
            return config.Enabled and G.EdgeBugToggleActive
        end
    elseif config.Mode == "Hold" then
        return config.Enabled and IsHoldKeyDown(config.Key)
    end
    return false
end

local ESPFolder
pcall(function()
    ESPFolder = Instance.new("Folder", game:GetService("CoreGui"))
    ESPFolder.Name = "ESP_Highlight_Container"
end)

local function NewDrawing(dt, props)
    local s, d = pcall(function()
        local dr = Drawing.new(dt)
        if dr and type(dr) ~= "number" then
            for k, v in pairs(props) do
                pcall(function() dr[k] = v end)
            end
            return dr
        end
        return nil
    end)
    if s and d and type(d) ~= "number" then
        AD(d)
        return d
    end
    return nil
end

local function CreatePlayerESP()
    local e = {Box = {}, BoxOutline = {}, Skeleton = {}, Fill = {}, LastVisCheck = 0, IsVisible = false, Valid = false, Root = nil, HeadPart = nil, Hum = nil, Char = nil}
    for i = 1, 4 do
        local outline = NewDrawing("Line", {Thickness = 3, Color = Color3.new(0, 0, 0), Visible = false, ZIndex = 1})
        if outline and type(outline) ~= "number" then e.BoxOutline[i] = outline end
        local box = NewDrawing("Line", {Thickness = 1, Visible = false, ZIndex = 2})
        if box and type(box) ~= "number" then e.Box[i] = box end
    end
    for i = 1, 2 do
        pcall(function()
            local tri = Drawing.new("Triangle")
            if tri and type(tri) ~= "number" then
                tri.Filled = true
                tri.Visible = false
                tri.Transparency = 0
                tri.ZIndex = 0
                AD(tri)
                e.Fill[i] = tri
            end
        end)
    end
    for i = 1, 20 do
        local skel = NewDrawing("Line", {Thickness = 2, Visible = false})
        if skel and type(skel) ~= "number" then e.Skeleton[i] = skel end
    end
    local headDot = NewDrawing("Circle", {Thickness = 1, NumSides = 30, Filled = false, Visible = false})
    if headDot and type(headDot) ~= "number" then e.HeadDot = headDot end
    local hpBg = NewDrawing("Line", {Thickness = 2, Visible = false, Color = Color3.new(0, 0, 0), Transparency = 0.5, ZIndex = 2})
    if hpBg and type(hpBg) ~= "number" then e.HpBg = hpBg end
    local hp = NewDrawing("Line", {Thickness = 2, Visible = false, ZIndex = 3})
    if hp and type(hp) ~= "number" then e.Hp = hp end
    local name = NewDrawing("Text", {Size = 13, Center = true, Outline = true, Font = 2, Visible = false})
    if name and type(name) ~= "number" then e.Name = name end
    local dist = NewDrawing("Text", {Size = 11, Center = true, Outline = true, Font = 2, Visible = false})
    if dist and type(dist) ~= "number" then e.Dist = dist end
    local weaponName = NewDrawing("Text", {Size = 12, Center = false, Outline = true, Font = 2, Visible = false})
    if weaponName and type(weaponName) ~= "number" then e.WeaponName = weaponName end
    pcall(function()
        if ESPFolder then
            e.HL = Instance.new("Highlight")
            e.HL.FillTransparency = 0.5
            e.HL.OutlineTransparency = 0
            e.HL.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
            e.HL.Enabled = false
            e.HL.Parent = ESPFolder
        end
    end)
    return e
end

local function DestroyPlayerESP(e)
    if not e then return end
    for _, d in pairs(e.Box) do if d and type(d) ~= "number" then pcall(function() d:Remove() end) end end
    for _, d in pairs(e.BoxOutline) do if d and type(d) ~= "number" then pcall(function() d:Remove() end) end end
    for _, d in pairs(e.Skeleton) do if d and type(d) ~= "number" then pcall(function() d:Remove() end) end end
    for _, d in pairs(e.Fill) do if d and type(d) ~= "number" then pcall(function() d:Remove() end) end end
    if e.HeadDot and type(e.HeadDot) ~= "number" then pcall(function() e.HeadDot:Remove() end) end
    if e.HpBg and type(e.HpBg) ~= "number" then pcall(function() e.HpBg:Remove() end) end
    if e.Hp and type(e.Hp) ~= "number" then pcall(function() e.Hp:Remove() end) end
    if e.Name and type(e.Name) ~= "number" then pcall(function() e.Name:Remove() end) end
    if e.Dist and type(e.Dist) ~= "number" then pcall(function() e.Dist:Remove() end) end
    if e.WeaponName and type(e.WeaponName) ~= "number" then pcall(function() e.WeaponName:Remove() end) end
    if e.HL then pcall(function() e.HL:Destroy() end) end
end

local function HidePlayerESP(e)
    if not e then return end
    for _, d in pairs(e.Box) do if d and type(d) ~= "number" then pcall(function() d.Visible = false end) end end
    for _, d in pairs(e.BoxOutline) do if d and type(d) ~= "number" then pcall(function() d.Visible = false end) end end
    for _, d in pairs(e.Skeleton) do if d and type(d) ~= "number" then pcall(function() d.Visible = false end) end end
    for _, d in pairs(e.Fill) do if d and type(d) ~= "number" then pcall(function() d.Visible = false end) end end
    if e.HeadDot and type(e.HeadDot) ~= "number" then pcall(function() e.HeadDot.Visible = false end) end
    if e.HpBg and type(e.HpBg) ~= "number" then pcall(function() e.HpBg.Visible = false end) end
    if e.Hp and type(e.Hp) ~= "number" then pcall(function() e.Hp.Visible = false end) end
    if e.Name and type(e.Name) ~= "number" then pcall(function() e.Name.Visible = false end) end
    if e.Dist and type(e.Dist) ~= "number" then pcall(function() e.Dist.Visible = false end) end
    if e.WeaponName and type(e.WeaponName) ~= "number" then pcall(function() e.WeaponName.Visible = false end) end
    if e.HL then pcall(function() e.HL.Enabled = false end) end
end

local function CreateWorldESPObject(hasName, hasRadius)
    local e = {Box = {}, HL = nil, Model = nil}
    if hasName then
        local name = NewDrawing("Text", {Size = 13, Center = true, Outline = true, Font = 2, Visible = false})
        if name and type(name) ~= "number" then e.Name = name end
    end
    if hasRadius then
        local radius = NewDrawing("Circle", {Thickness = 1.5, Filled = false, Visible = false, NumSides = 60})
        if radius and type(radius) ~= "number" then e.Radius = radius end
    end
    for i = 1, 4 do
        local box = NewDrawing("Line", {Thickness = 1, Visible = false, ZIndex = 2})
        if box and type(box) ~= "number" then e.Box[i] = box end
    end
    if ESPFolder then
        pcall(function()
            e.HL = Instance.new("Highlight")
            e.HL.FillTransparency = 0.5
            e.HL.OutlineTransparency = 0
            e.HL.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
            e.HL.Enabled = false
            e.HL.Parent = ESPFolder
        end)
    end
    return e
end

local function HideWorldESPObject(e)
    if not e then return end
    for _, d in pairs(e.Box) do if d and type(d) ~= "number" then pcall(function() d.Visible = false end) end end
    if e.Name and type(e.Name) ~= "number" then pcall(function() e.Name.Visible = false end) end
    if e.Radius and type(e.Radius) ~= "number" then pcall(function() e.Radius.Visible = false end) end
    if e.HL then pcall(function() e.HL.Enabled = false end) end
end

local function HideAllWorldESP()
    for _, eo in pairs(WorldESP.DroppedWeapons) do HideWorldESPObject(eo) end
    if WorldESP.Bomb then HideWorldESPObject(WorldESP.Bomb) end
    for _, eo in pairs(WorldESP.Molotovs) do HideWorldESPObject(eo) end
    for _, eo in pairs(WorldESP.Smokes) do HideWorldESPObject(eo) end
end

local BONES_R15 = {{"Head","UpperTorso"},{"UpperTorso","LowerTorso"},{"LowerTorso","HumanoidRootPart"},{"UpperTorso","LeftUpperArm"},{"LeftUpperArm","LeftLowerArm"},{"LeftLowerArm","LeftHand"},{"UpperTorso","RightUpperArm"},{"RightUpperArm","RightLowerArm"},{"RightLowerArm","RightHand"},{"HumanoidRootPart","LeftUpperLeg"},{"LeftUpperLeg","LeftLowerLeg"},{"LeftLowerLeg","LeftFoot"},{"HumanoidRootPart","RightUpperLeg"},{"RightUpperLeg","RightLowerLeg"},{"RightLowerLeg","RightFoot"}}
local BONES_R6 = {{"Head","Torso"},{"Torso","HumanoidRootPart"},{"Torso","Left Arm"},{"Torso","Right Arm"},{"HumanoidRootPart","Left Leg"},{"HumanoidRootPart","Right Leg"}}

local bonePosCache = {}

local InventoryController, GetWeaponProperties

local function InitInventory()
    if not G.knifeChangerSupported then return end
    if not InventoryController then
        pcall(function()
            local module = RepStore:FindFirstChild("Controllers") and RepStore.Controllers:FindFirstChild("InventoryController")
            if module then
                local result = SafeRequire(module)
                if result then InventoryController = result end
            end
        end)
    end
    if not GetWeaponProperties then
        pcall(function()
            local module = RepStore:FindFirstChild("Components") and RepStore.Components:FindFirstChild("Common") and RepStore.Components.Common:FindFirstChild("GetWeaponProperties")
            if module then
                local result = SafeRequire(module)
                if result then GetWeaponProperties = result end
            end
        end)
    end
end

InitInventory()
if not InventoryController then G.knifeChangerSupported = false end

local Router
pcall(function()
    local module = RepStore:FindFirstChild("Database") and RepStore.Database:FindFirstChild("Security") and RepStore.Database.Security:FindFirstChild("Router")
    if module then Router = SafeRequire(module) end
end)

local function inspectWeapon(weapon, skin, float)
    if not Router then return end
    pcall(function() Router.broadcastRouter("WeaponInspect", weapon, skin, float or 0.01, nil, nil, nil, nil, "Weapon", nil, "fake_id", nil, false) end)
end

local UIE = {}

local function CreateMainUI()
    local M = Instance.new("Frame")
    M.Name = "MainFrame"
    M.Size = UDim2.new(0, 550, 0, 400)
    M.Position = UDim2.new(0.5, -275, 0.5, -200)
    M.BorderSizePixel = 0
    M.Parent = UI
    AddThemeObject(M, "Main")
    MakeDraggable(M)

    local MS = Instance.new("UIStroke", M)
    MS.Thickness = 1
    AddThemeObject(MS, "Outline")

    local TB = Instance.new("Frame")
    TB.Size = UDim2.new(1, 0, 0, 40)
    TB.BackgroundTransparency = 1
    TB.Parent = M

    local T = Instance.new("TextLabel")
    T.Text = "bankroll - free version"
    T.Font = Enum.Font.ArialBold
    T.TextSize = 18
    T.Size = UDim2.new(1, 0, 1, 0)
    T.BackgroundTransparency = 1
    T.TextStrokeTransparency = 0
    T.Parent = TB
    AddThemeObject(T, "Text")

    local TL = Instance.new("Frame")
    TL.Size = UDim2.new(1, 0, 0, 2)
    TL.Position = UDim2.new(0, 0, 1, -2)
    TL.BorderSizePixel = 0
    TL.Parent = TB
    AddThemeObject(TL, "Accent")

    local DB = Instance.new("TextButton")
    DB.Name = "DiscordBtn"
    DB.Size = UDim2.new(0, 60, 0, 20)
    DB.Position = UDim2.new(1, -70, 0.5, 0)
    DB.AnchorPoint = Vector2.new(0, 0.5)
    DB.BackgroundColor3 = Color3.fromRGB(88, 101, 242)
    DB.Text = "Discord"
    DB.Font = Enum.Font.GothamBold
    DB.TextSize = 12
    DB.TextColor3 = Color3.new(1, 1, 1)
    DB.Parent = TB

    local CA = Instance.new("Frame")
    CA.Size = UDim2.new(1, -20, 1, -80)
    CA.Position = UDim2.new(0, 10, 0, 45)
    CA.BackgroundTransparency = 1
    CA.Parent = M

    local TBR = Instance.new("ScrollingFrame")
    TBR.Size = UDim2.new(1, 0, 0, 35)
    TBR.Position = UDim2.new(0, 0, 1, -35)
    TBR.BackgroundTransparency = 1
    TBR.BorderSizePixel = 0
    TBR.ScrollBarThickness = 2
    TBR.AutomaticCanvasSize = Enum.AutomaticSize.X
    TBR.CanvasSize = UDim2.new(0, 0, 0, 0)
    TBR.Parent = M

    local TBL = Instance.new("UIListLayout")
    TBL.FillDirection = Enum.FillDirection.Horizontal
    TBL.HorizontalAlignment = Enum.HorizontalAlignment.Left
    TBL.Padding = UDim.new(0, 5)
    TBL.Parent = TBR

    UIE.Main = M
    UIE.DiscordBtn = DB
    UIE.ContentArea = CA
    UIE.TabBar = TBR
    return M
end

local Main = CreateMainUI()

local function JoinDiscord()
    local code = "Pmnk9e6egS"
    local req = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request
    if req then 
        pcall(function() 
            req({Url = 'http://127.0.0.1:6463/rpc?v=1', Method = 'POST', Headers = {['Content-Type'] = 'application/json', ['Origin'] = 'https://discord.com'}, Body = HS:JSONEncode({cmd = 'INVITE_BROWSER', nonce = HS:GenerateGUID(false), args = {code = code}})}) 
        end) 
    end
    if setclipboard then 
        pcall(function() setclipboard("https://discord.gg/" .. code) end) 
    end
end

local Tabs = {}
local UIListeners = {}
local ColorPickerPopups = {}

local function RefreshUI() 
    for _, f in pairs(UIListeners) do pcall(f) end 
    RefreshTheme() 
end

local function CreateTab(name)
    local Btn = Instance.new("TextButton")
    Btn.Text = name
    Btn.Size = UDim2.new(0, 75, 1, 0)
    Btn.BackgroundTransparency = 1
    Btn.Font = Enum.Font.ArialBold
    Btn.TextSize = 14
    Btn.TextStrokeTransparency = 0
    Btn.Parent = UIE.TabBar

    local Ln = Instance.new("Frame")
    Ln.Size = UDim2.new(1, 0, 0, 2)
    Ln.Position = UDim2.new(0, 0, 1, 0)
    Ln.BorderSizePixel = 0
    Ln.Visible = false
    Ln.Parent = Btn
    AddThemeObject(Ln, "Accent")

    local Pg = Instance.new("ScrollingFrame")
    Pg.Size = UDim2.new(1, 0, 1, 0)
    Pg.BackgroundTransparency = 1
    Pg.ScrollBarThickness = 2
    Pg.Visible = false
    Pg.AutomaticCanvasSize = Enum.AutomaticSize.Y
    Pg.Parent = UIE.ContentArea

    local PgLayout = Instance.new("UIListLayout", Pg)
    PgLayout.Padding = UDim.new(0, 5)
    PgLayout.SortOrder = Enum.SortOrder.LayoutOrder

    Instance.new("UIPadding", Pg).PaddingLeft = UDim.new(0, 5)
    Pg:FindFirstChildOfClass("UIPadding").PaddingTop = UDim.new(0, 5)

    local TO = {Button = Btn, Page = Pg, Line = Ln}

    Btn.MouseButton1Down:Connect(function()
        for _, t in pairs(Tabs) do 
            t.Page.Visible = false
            t.Line.Visible = false
            AddThemeObject(t.Button, "TextDim") 
        end
        for _, pop in pairs(ColorPickerPopups) do pcall(function() pop.Visible = false end) end
        Pg.Visible = true
        Ln.Visible = true
        AddThemeObject(Btn, "Text")
    end)

    if #Tabs == 0 then 
        Pg.Visible = true
        Ln.Visible = true
        AddThemeObject(Btn, "Text") 
    else 
        AddThemeObject(Btn, "TextDim") 
    end

    Tabs[#Tabs + 1] = TO
    return Pg
end

local function CreateSplitTab(name)
    local Btn = Instance.new("TextButton")
    Btn.Text = name
    Btn.Size = UDim2.new(0, 75, 1, 0)
    Btn.BackgroundTransparency = 1
    Btn.Font = Enum.Font.ArialBold
    Btn.TextSize = 14
    Btn.TextStrokeTransparency = 0
    Btn.Parent = UIE.TabBar

    local Ln = Instance.new("Frame")
    Ln.Size = UDim2.new(1, 0, 0, 2)
    Ln.Position = UDim2.new(0, 0, 1, 0)
    Ln.BorderSizePixel = 0
    Ln.Visible = false
    Ln.Parent = Btn
    AddThemeObject(Ln, "Accent")

    local Container = Instance.new("Frame")
    Container.Size = UDim2.new(1, 0, 1, 0)
    Container.BackgroundTransparency = 1
    Container.Visible = false
    Container.Parent = UIE.ContentArea

    local Left = Instance.new("ScrollingFrame")
    Left.Size = UDim2.new(0.5, -5, 1, 0)
    Left.BackgroundTransparency = 1
    Left.ScrollBarThickness = 2
    Left.AutomaticCanvasSize = Enum.AutomaticSize.Y
    Left.Parent = Container
    Instance.new("UIListLayout", Left).Padding = UDim.new(0, 5)
    Left:FindFirstChildOfClass("UIListLayout").SortOrder = Enum.SortOrder.LayoutOrder
    local lp = Instance.new("UIPadding", Left)
    lp.PaddingLeft = UDim.new(0, 5)
    lp.PaddingTop = UDim.new(0, 5)

    local Right = Instance.new("ScrollingFrame")
    Right.Size = UDim2.new(0.5, -5, 1, 0)
    Right.Position = UDim2.new(0.5, 5, 0, 0)
    Right.BackgroundTransparency = 1
    Right.ScrollBarThickness = 2
    Right.AutomaticCanvasSize = Enum.AutomaticSize.Y
    Right.Parent = Container
    Instance.new("UIListLayout", Right).Padding = UDim.new(0, 5)
    Right:FindFirstChildOfClass("UIListLayout").SortOrder = Enum.SortOrder.LayoutOrder
    local rp = Instance.new("UIPadding", Right)
    rp.PaddingLeft = UDim.new(0, 5)
    rp.PaddingTop = UDim.new(0, 5)

    local TO = {Button = Btn, Page = Container, Line = Ln}

    Btn.MouseButton1Down:Connect(function()
        for _, t in pairs(Tabs) do 
            t.Page.Visible = false
            t.Line.Visible = false
            AddThemeObject(t.Button, "TextDim") 
        end
        for _, pop in pairs(ColorPickerPopups) do pcall(function() pop.Visible = false end) end
        Container.Visible = true
        Ln.Visible = true
        AddThemeObject(Btn, "Text")
    end)

    if #Tabs == 0 then 
        Container.Visible = true
        Ln.Visible = true
        AddThemeObject(Btn, "Text") 
    else 
        AddThemeObject(Btn, "TextDim") 
    end

    Tabs[#Tabs + 1] = TO
    return Left, Right
end

local function CreateToggle(p, t, c, k, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 25)
    F.BackgroundTransparency = 1
    F.Parent = p

    local L = Instance.new("TextLabel")
    L.Text = t
    L.Size = UDim2.new(0.8, 0, 1, 0)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.Arial
    L.TextSize = 13
    L.TextXAlignment = Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = F
    AddThemeObject(L, "Text")

    local TB = Instance.new("TextButton")
    TB.Size = UDim2.new(1, 0, 1, 0)
    TB.BackgroundTransparency = 1
    TB.Text = ""
    TB.Parent = F

    local Bx = Instance.new("Frame")
    Bx.Size = UDim2.new(0, 14, 0, 14)
    Bx.Position = UDim2.new(1, -18, 0.5, 0)
    Bx.AnchorPoint = Vector2.new(0, 0.5)
    Bx.BorderSizePixel = 0
    Bx.Parent = F

    local function U() 
        if c[k] then AddThemeObject(Bx, "Accent") else AddThemeObject(Bx, "Item") end 
    end
    UIListeners[#UIListeners + 1] = U
    U()

    TB.MouseButton1Down:Connect(function() 
        c[k] = not c[k]
        U()
        if cb then cb(c[k]) end 
    end)

    return F
end

local function CreateSlider(p, t, mn, mx, c, k, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 35)
    F.BackgroundTransparency = 1
    F.Parent = p

    local L = Instance.new("TextLabel")
    L.Text = t .. ": " .. tostring(c[k])
    L.Size = UDim2.new(1, 0, 0, 18)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.Arial
    L.TextSize = 13
    L.TextXAlignment = Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = F
    AddThemeObject(L, "Text")

    local SB = Instance.new("Frame")
    SB.Size = UDim2.new(1, -10, 0, 5)
    SB.Position = UDim2.new(0, 5, 0, 22)
    SB.BorderSizePixel = 0
    SB.Parent = F
    AddThemeObject(SB, "Item")

    local Fl = Instance.new("Frame")
    Fl.Size = UDim2.new((c[k] - mn) / (mx - mn), 0, 1, 0)
    Fl.BorderSizePixel = 0
    Fl.Parent = SB
    AddThemeObject(Fl, "Accent")

    local SBtn = Instance.new("TextButton")
    SBtn.Size = UDim2.new(1, 0, 1, 0)
    SBtn.BackgroundTransparency = 1
    SBtn.Text = ""
    SBtn.Parent = SB

    local function U() 
        L.Text = t .. ": " .. tostring(math.floor(c[k] * 100 + 0.5) / 100)
        Fl.Size = UDim2.new(math.clamp((c[k] - mn) / (mx - mn), 0, 1), 0, 1, 0) 
    end
    UIListeners[#UIListeners + 1] = U
    U()

    SBtn.MouseButton1Down:Connect(function()
        local mv, kl
        mv = UIS.InputChanged:Connect(function(mi) 
            if mi.UserInputType == Enum.UserInputType.MouseMovement then
                local s = math.clamp((mi.Position.X - SB.AbsolutePosition.X) / SB.AbsoluteSize.X, 0, 1)
                local v = mn + ((mx - mn) * s)
                if mx > 10 then v = math.floor(v) else v = math.floor(v * 100) / 100 end
                c[k] = v
                U()
                if cb then cb(v) end
            end 
        end)
        kl = UIS.InputEnded:Connect(function(ei) 
            if ei.UserInputType == Enum.UserInputType.MouseButton1 then
                if mv then mv:Disconnect() end
                if kl then kl:Disconnect() end
            end 
        end)
    end)
end

local function CreateColorPicker(p, t, c, k, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 25)
    F.BackgroundTransparency = 1
    F.Parent = p

    local L = Instance.new("TextLabel")
    L.Text = t
    L.Size = UDim2.new(0.7, 0, 1, 0)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.Arial
    L.TextSize = 13
    L.TextXAlignment = Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = F
    AddThemeObject(L, "Text")

    local Pv = Instance.new("TextButton")
    Pv.Size = UDim2.new(0, 24, 0, 14)
    Pv.Position = UDim2.new(1, -28, 0.5, 0)
    Pv.AnchorPoint = Vector2.new(0, 0.5)
    Pv.BackgroundColor3 = c[k]
    Pv.BorderSizePixel = 0
    Pv.Text = ""
    Pv.Parent = F

    local Pop = Instance.new("Frame")
    Pop.Size = UDim2.new(0, 150, 0, 150)
    Pop.ZIndex = 100
    Pop.Visible = false
    Pop.BorderSizePixel = 0
    Pop.Parent = Main
    AddThemeObject(Pop, "Main")

    ColorPickerPopups[#ColorPickerPopups + 1] = Pop

    local PS = Instance.new("UIStroke", Pop)
    PS.Thickness = 1
    AddThemeObject(PS, "Outline")

    local HF = Instance.new("Frame")
    HF.Size = UDim2.new(1, -20, 0, 20)
    HF.Position = UDim2.new(0, 10, 0, 10)
    HF.BorderSizePixel = 0
    HF.Parent = Pop
    Instance.new("UIGradient", HF).Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
        ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 255, 0)),
        ColorSequenceKeypoint.new(0.33, Color3.fromRGB(0, 255, 0)),
        ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 255)),
        ColorSequenceKeypoint.new(0.66, Color3.fromRGB(0, 0, 255)),
        ColorSequenceKeypoint.new(0.83, Color3.fromRGB(255, 0, 255)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0))
    })

    local HBtn = Instance.new("TextButton", HF)
    HBtn.Size = UDim2.new(1, 0, 1, 0)
    HBtn.BackgroundTransparency = 1
    HBtn.Text = ""

    local SVF = Instance.new("Frame")
    SVF.Size = UDim2.new(1, -20, 0, 100)
    SVF.Position = UDim2.new(0, 10, 0, 40)
    SVF.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
    SVF.BorderSizePixel = 0
    SVF.Parent = Pop
    Instance.new("UIGradient", SVF).Color = ColorSequence.new(Color3.new(1, 1, 1), Color3.new(0, 0, 0))
    SVF:FindFirstChildOfClass("UIGradient").Rotation = 90

    local SVBtn = Instance.new("TextButton", SVF)
    SVBtn.Size = UDim2.new(1, 0, 1, 0)
    SVBtn.BackgroundTransparency = 1
    SVBtn.Text = ""

    local h, s, v = c[k]:ToHSV()

    local function U() 
        Pv.BackgroundColor3 = c[k]
        h, s, v = c[k]:ToHSV() 
    end
    UIListeners[#UIListeners + 1] = U

    HBtn.MouseButton1Down:Connect(function()
        local mv, kl
        mv = UIS.InputChanged:Connect(function(mi) 
            if mi.UserInputType == Enum.UserInputType.MouseMovement then
                h = math.clamp((mi.Position.X - HF.AbsolutePosition.X) / HF.AbsoluteSize.X, 0, 1)
                SVF.BackgroundColor3 = Color3.fromHSV(h, 1, 1)
                local cc = Color3.fromHSV(h, s, v)
                c[k] = cc
                Pv.BackgroundColor3 = cc
                if cb then cb(cc) end
            end 
        end)
        kl = UIS.InputEnded:Connect(function(ei) 
            if ei.UserInputType == Enum.UserInputType.MouseButton1 then
                if mv then mv:Disconnect() end
                if kl then kl:Disconnect() end
            end 
        end)
    end)

    SVBtn.MouseButton1Down:Connect(function()
        local mv, kl
        mv = UIS.InputChanged:Connect(function(mi) 
            if mi.UserInputType == Enum.UserInputType.MouseMovement then
                s = math.clamp((mi.Position.X - SVF.AbsolutePosition.X) / SVF.AbsoluteSize.X, 0, 1)
                v = 1 - math.clamp((mi.Position.Y - SVF.AbsolutePosition.Y) / SVF.AbsoluteSize.Y, 0, 1)
                local cc = Color3.fromHSV(h, s, v)
                c[k] = cc
                Pv.BackgroundColor3 = cc
                if cb then cb(cc) end
            end 
        end)
        kl = UIS.InputEnded:Connect(function(ei) 
            if ei.UserInputType == Enum.UserInputType.MouseButton1 then
                if mv then mv:Disconnect() end
                if kl then kl:Disconnect() end
            end 
        end)
    end)

    Pv.MouseButton1Down:Connect(function()
        Pop.Visible = not Pop.Visible
        if Pop.Visible then
            local ap = Pv.AbsolutePosition
            local mp = Main.AbsolutePosition
            Pop.Position = UDim2.new(0, (ap.X - mp.X) + Pv.AbsoluteSize.X + 5, 0, ap.Y - mp.Y)
        end
    end)

    return F
end

local function CreateKeybind(p, t, c, k, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 25)
    F.BackgroundTransparency = 1
    F.Parent = p

    local L = Instance.new("TextLabel")
    L.Text = t
    L.Size = UDim2.new(0.6, 0, 1, 0)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.Arial
    L.TextSize = 13
    L.TextXAlignment = Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = F
    AddThemeObject(L, "Text")

    local BB = Instance.new("TextButton")
    BB.Size = UDim2.new(0, 70, 0, 18)
    BB.Position = UDim2.new(1, -74, 0.5, 0)
    BB.AnchorPoint = Vector2.new(0, 0.5)
    BB.Text = (c[k] and c[k].Name) or "None"
    BB.Font = Enum.Font.Arial
    BB.TextSize = 11
    BB.Parent = F
    AddThemeObject(BB, "Item")
    AddThemeObject(BB, "Text")

    local function U() 
        BB.Text = (c[k] and c[k].Name) or "None" 
    end
    UIListeners[#UIListeners + 1] = U

    BB.MouseButton1Click:Connect(function()
        BB.Text = "..."
        local bi = UIS.InputBegan:Wait()
        if bi.UserInputType == Enum.UserInputType.Keyboard or bi.UserInputType == Enum.UserInputType.MouseButton1 or bi.UserInputType == Enum.UserInputType.MouseButton2 then
            local ik = bi.KeyCode
            if ik == Enum.KeyCode.Unknown then ik = bi.UserInputType end
            c[k] = ik
            BB.Text = ik.Name
            if cb then cb(ik) end
        end
    end)
end

local function CreateButton(p, t, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 25)
    F.BackgroundTransparency = 1
    F.Parent = p

    local Btn = Instance.new("TextButton")
    Btn.Size = UDim2.new(1, -10, 1, -4)
    Btn.Position = UDim2.new(0, 5, 0, 2)
    Btn.BackgroundColor3 = CurrentTheme.Item
    Btn.Text = t
    Btn.Font = Enum.Font.Arial
    Btn.TextSize = 13
    Btn.TextColor3 = CurrentTheme.Text
    Btn.Parent = F
    AddThemeObject(Btn, "Item")
    AddThemeObject(Btn, "Text")

    Instance.new("UICorner", Btn).CornerRadius = UDim.new(0, 4)
    Btn.MouseButton1Down:Connect(function() if cb then cb() end end)
end

local function CreateLabel(p, t, sz, al)
    local L = Instance.new("TextLabel")
    L.Text = t
    L.Size = UDim2.new(1, 0, 0, sz or 18)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.ArialBold
    L.TextSize = sz or 13
    L.TextXAlignment = al or Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = p
    AddThemeObject(L, "Text")
    return L
end

local function CreateSingleDropdown(p, t, opts, c, k, cb)
    local F = Instance.new("Frame")
    F.Size = UDim2.new(1, 0, 0, 38)
    F.BackgroundTransparency = 1
    F.Parent = p
    F.ZIndex = 2

    local L = Instance.new("TextLabel")
    L.Text = t
    L.Size = UDim2.new(1, 0, 0, 18)
    L.BackgroundTransparency = 1
    L.Font = Enum.Font.Arial
    L.TextSize = 13
    L.TextXAlignment = Enum.TextXAlignment.Left
    L.TextStrokeTransparency = 0
    L.Parent = F
    AddThemeObject(L, "Text")

    local TB = Instance.new("TextButton")
    TB.Size = UDim2.new(1, -10, 0, 18)
    TB.Position = UDim2.new(0, 5, 0, 18)
    TB.Text = c[k] or opts[1]
    TB.Font = Enum.Font.Arial
    TB.TextSize = 11
    TB.BorderSizePixel = 0
    TB.BackgroundColor3 = CurrentTheme.Item
    TB.Parent = F
    AddThemeObject(TB, "Item")
    AddThemeObject(TB, "Text")

    local Lst = Instance.new("ScrollingFrame")
    Lst.Size = UDim2.new(0, 200, 0, 150)
    Lst.Visible = false
    Lst.CanvasSize = UDim2.new(0, 0, 0, 0)
    Lst.ZIndex = 100
    Lst.BorderSizePixel = 0
    Lst.ScrollBarThickness = 2
    Lst.Parent = Main
    AddThemeObject(Lst, "Item")
    Instance.new("UIStroke", Lst).Thickness = 1
    AddThemeObject(Lst:FindFirstChildOfClass("UIStroke"), "Outline")
    Instance.new("UIListLayout", Lst)

    local function U() 
        TB.Text = c[k] or opts[1] 
    end
    UIListeners[#UIListeners + 1] = U

    local pop = false
    TB.MouseButton1Down:Connect(function()
        Lst.Visible = not Lst.Visible
        if Lst.Visible and not pop then
            pop = true
            for _, opt in pairs(opts) do
                local OB = Instance.new("TextButton")
                OB.Size = UDim2.new(1, 0, 0, 18)
                OB.Text = opt
                OB.Font = Enum.Font.Arial
                OB.TextSize = 11
                OB.BackgroundTransparency = 1
                OB.Parent = Lst
                AddThemeObject(OB, "Text")
                OB.MouseButton1Down:Connect(function() 
                    c[k] = opt
                    TB.Text = opt
                    Lst.Visible = false
                    if cb then cb(opt) end 
                end)
            end
            Lst.CanvasSize = UDim2.new(0, 0, 0, #opts * 18)
        end
        if Lst.Visible then
            local ap = TB.AbsolutePosition
            local mp = Main.AbsolutePosition
            Lst.Position = UDim2.new(0, ap.X - mp.X, 0, (ap.Y - mp.Y) + TB.AbsoluteSize.Y + 2)
            Lst.Size = UDim2.new(0, TB.AbsoluteSize.X, 0, math.min(#opts * 18, 150))
        end
    end)
    return F
end

local function CreateWatermark()
    local WF = Instance.new("Frame")
    WF.Name = "Watermark"
    WF.Size = UDim2.new(0, 200, 0, 28)
    WF.Position = UDim2.new(0.98, -200, 0.02, 0)
    WF.BorderSizePixel = 0
    WF.Visible = Config.Watermark
    WF.Parent = UI
    AddThemeObject(WF, "Main")
    MakeDraggable(WF)

    Instance.new("UIStroke", WF).Thickness = 1
    AddThemeObject(WF:FindFirstChildOfClass("UIStroke"), "Outline")
    Instance.new("UICorner", WF).CornerRadius = UDim.new(0, 6)

    local WL = Instance.new("TextLabel")
    WL.Size = UDim2.new(1, 0, 1, 0)
    WL.BackgroundTransparency = 1
    WL.Font = Enum.Font.GothamBold
    WL.TextSize = 14
    WL.TextStrokeTransparency = 0
    WL.Parent = WF
    AddThemeObject(WL, "Text")

    task.spawn(Safe(function()
        while true do
            if WF and WF.Parent and WF.Visible then
                local n = tick()
                local e = n - G.lastFPSUpdate
                if e >= 1 then
                    local fps = math.floor(G.FrameCount / (e + 0.0001))
                    G.FrameCount = 0
                    G.lastFPSUpdate = n
                    pcall(function()
                        WL.Text = string.format("bankroll | fps: %d | %s", fps, os.date("%H:%M:%S"))
                        WF.Size = UDim2.new(0, WL.TextBounds.X + 24, 0, 28)
                    end)
                end
            end
            task.wait(0.1)
        end
    end))

    return WF
end

local WatermarkFrame = CreateWatermark()

local function CreateKeybindList()
    local KL = Instance.new("Frame")
    KL.Name = "KeybindList"
    KL.Size = UDim2.new(0, 200, 0, 0)
    KL.AutomaticSize = Enum.AutomaticSize.Y
    KL.Position = UDim2.new(0.01, 0, 0.5, 0)
    KL.BorderSizePixel = 0
    KL.Parent = UI
    AddThemeObject(KL, "Main")
    MakeDraggable(KL)

    Instance.new("UIStroke", KL).Thickness = 1
    AddThemeObject(KL:FindFirstChildOfClass("UIStroke"), "Outline")
    Instance.new("UICorner", KL).CornerRadius = UDim.new(0, 6)

    local KH = Instance.new("TextLabel")
    KH.Size = UDim2.new(1, 0, 0, 20)
    KH.Text = "Keybinds"
    KH.Font = Enum.Font.GothamBold
    KH.TextSize = 14
    KH.BackgroundTransparency = 1
    KH.LayoutOrder = -1
    KH.Parent = KL
    AddThemeObject(KH, "Text")

    local KP = Instance.new("UIPadding", KL)
    KP.PaddingTop = UDim.new(0, 5)
    KP.PaddingBottom = UDim.new(0, 5)
    KP.PaddingLeft = UDim.new(0, 10)
    KP.PaddingRight = UDim.new(0, 10)

    Instance.new("UIListLayout", KL).SortOrder = Enum.SortOrder.LayoutOrder

    local function MKL() 
        local L = Instance.new("TextLabel")
        L.Size = UDim2.new(1, 0, 0, 20)
        L.BackgroundTransparency = 1
        L.Font = Enum.Font.GothamBold
        L.TextSize = 14
        L.TextStrokeTransparency = 0
        L.TextXAlignment = Enum.TextXAlignment.Left
        L.Parent = KL
        L.Visible = false
        AddThemeObject(L, "Text")
        return L 
    end

    return KL, MKL(), MKL(), MKL(), MKL(), MKL()
end

local KeybindList, AimbotKeyLabel, BhopKeyLabel, TriggerKeyLabel, JBKeyLabel, EBKeyLabel = CreateKeybindList()

local function CreateSpectatorList()
    local SL = Instance.new("Frame")
    SL.Name = "SpectatorList"
    SL.Size = UDim2.new(0, 200, 0, 30)
    SL.Position = UDim2.new(0.98, -200, 0.02, 28)
    SL.BorderSizePixel = 0
    SL.Parent = UI
    SL.Visible = false
    AddThemeObject(SL, "Main")
    MakeDraggable(SL)

    Instance.new("UIStroke", SL).Thickness = 1
    AddThemeObject(SL:FindFirstChildOfClass("UIStroke"), "Outline")
    Instance.new("UICorner", SL).CornerRadius = UDim.new(0, 6)

    local SLb = Instance.new("TextLabel", SL)
    SLb.Size = UDim2.new(1, 0, 1, 0)
    SLb.BackgroundTransparency = 1
    SLb.Font = Enum.Font.GothamBold
    SLb.TextSize = 14
    AddThemeObject(SLb, "Text")

    return SL, SLb
end

local SpectatorList, SpecLabel = CreateSpectatorList()

AC(UIS.InputBegan:Connect(Safe(function(input)
    local typing = UIS:GetFocusedTextBox() ~= nil
    if not typing and (input.KeyCode == Enum.KeyCode.RightShift or input.KeyCode == Enum.KeyCode.End or input.KeyCode == Enum.KeyCode.K or input.KeyCode == Enum.KeyCode.Home or input.KeyCode == Enum.KeyCode.Insert) then 
        Main.Visible = not Main.Visible 
    end
    if not typing then
        if Config.Aimbot.HoldKey and (input.KeyCode == Config.Aimbot.HoldKey or input.UserInputType == Config.Aimbot.HoldKey) then 
            if Config.Aimbot.Mode == "Toggle" then G.AimbotActive = not G.AimbotActive end 
        end
        if Config.Triggerbot.HoldKey and (input.KeyCode == Config.Triggerbot.HoldKey or input.UserInputType == Config.Triggerbot.HoldKey) then 
            if Config.Triggerbot.Mode == "Toggle" then G.TriggerbotActive = not G.TriggerbotActive end 
        end

        if Config.JumpBug.Key and (input.KeyCode == Config.JumpBug.Key or input.UserInputType == Config.JumpBug.Key) then 
            if Config.JumpBug.Mode == "Toggle" then G.JumpBugActive = not G.JumpBugActive end 
        end

        if Config.EdgeBug.Key and (input.KeyCode == Config.EdgeBug.Key or input.UserInputType == Config.EdgeBug.Key) then 
            if Config.EdgeBug.Mode == "Toggle" then G.EdgeBugToggleActive = not G.EdgeBugToggleActive end 
        end
    end
end)))

local LegitTab = CreateTab("Legitbot")
local MovementTab = CreateTab("Movement")
local VisualsLeft, VisualsRight = CreateSplitTab("Visuals")
local SkinLeft, SkinRight = CreateSplitTab("Skin Changer")
local MiscTab = CreateTab("Misc")
local SettingsLeft, SettingsRight = CreateSplitTab("Settings")

local visCheckFrames = {}

local function SetupLegitTab()
    CreateLabel(LegitTab, "aimbot", 14, Enum.TextXAlignment.Center)
    CreateToggle(LegitTab, "Enabled", Config.Aimbot, "Enabled", function(v) if not v then G.AimbotActive = false end end)
    CreateToggle(LegitTab, "Team Check", Config.Aimbot, "TeamCheck")
    CreateToggle(LegitTab, "Alive Check", Config.Aimbot, "AliveCheck")
    CreateSlider(LegitTab, "FOV", 0, 500, Config.Aimbot, "FOV")
    CreateSlider(LegitTab, "Smoothness", 1, 20, Config.Aimbot, "Smoothness")
    CreateSingleDropdown(LegitTab, "Target Part", {"Head", "HumanoidRootPart", "Torso"}, Config.Aimbot, "TargetPart")
    CreateToggle(LegitTab, "Wall Check", Config.Aimbot, "WallCheck")
    CreateToggle(LegitTab, "Draw FOV", Config.Aimbot, "DrawFOV")
    CreateKeybind(LegitTab, "Key", Config.Aimbot, "HoldKey")
    CreateSingleDropdown(LegitTab, "Mode", {"Hold", "Toggle"}, Config.Aimbot, "Mode")

    CreateLabel(LegitTab, "triggerbot", 14, Enum.TextXAlignment.Center)
    CreateToggle(LegitTab, "Triggerbot", Config.Triggerbot, "Enabled")
    CreateToggle(LegitTab, "Triggerbot Team Check", Config.Triggerbot, "TeamCheck")
    CreateKeybind(LegitTab, "Key", Config.Triggerbot, "HoldKey")
    CreateSingleDropdown(LegitTab, "Trigger Mode", {"Hold", "Toggle"}, Config.Triggerbot, "Mode")
    CreateSlider(LegitTab, "Triggerbot Delay (s)", 0, 1, Config.Triggerbot, "Delay")
end
SetupLegitTab()

local function SetupVisualsTab()
    CreateLabel(VisualsLeft, "player esp", 14, Enum.TextXAlignment.Center)
    CreateToggle(VisualsLeft, "Enabled", Config.ESP, "Enabled", function(v) if not v then for _, e in pairs(ESP_.Players) do HidePlayerESP(e) end end end)
    CreateToggle(VisualsLeft, "Team Check", Config.ESP, "TeamCheck")
    CreateToggle(VisualsLeft, "Visibility Check", Config.ESP, "VisibilityCheck", function(v) for _, f in pairs(visCheckFrames) do pcall(function() f.Visible = v end) end end)
    CreateSlider(VisualsLeft, "Max Distance", 100, 5000, Config.ESP, "MaxDistance")
    CreateToggle(VisualsLeft, "Box", Config.ESP, "Box")
    CreateToggle(VisualsLeft, "Box Outline", Config.ESP, "BoxOutline")
    CreateSlider(VisualsLeft, "Box Thickness", 1, 5, Config.ESP, "BoxThickness")
    CreateColorPicker(VisualsLeft, "Box Color", Config.ESP, "BoxColor")
    local bvF = CreateColorPicker(VisualsLeft, "Box Visible", Config.ESP, "BoxVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = bvF
    bvF.Visible = Config.ESP.VisibilityCheck
    local bhF = CreateColorPicker(VisualsLeft, "Box Hidden", Config.ESP, "BoxNotVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = bhF
    bhF.Visible = Config.ESP.VisibilityCheck
    CreateToggle(VisualsLeft, "Box Fill", Config.ESP, "BoxFill")
    CreateColorPicker(VisualsLeft, "Fill Color 1", Config.ESP, "BoxFillColor1")
    CreateColorPicker(VisualsLeft, "Fill Color 2", Config.ESP, "BoxFillColor2")
    CreateSlider(VisualsLeft, "Fill Transparency", 0, 1, Config.ESP, "BoxFillTransparency")
    CreateSlider(VisualsLeft, "Fade Speed", 0.5, 10, Config.ESP, "BoxFillFadeSpeed")
    CreateToggle(VisualsLeft, "Name", Config.ESP, "Name")
    CreateSlider(VisualsLeft, "Name Size", 8, 24, Config.ESP, "NameSize")
    CreateColorPicker(VisualsLeft, "Name Color", Config.ESP, "NameColor")
    local nvF = CreateColorPicker(VisualsLeft, "Name Visible", Config.ESP, "NameVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = nvF
    nvF.Visible = Config.ESP.VisibilityCheck
    local nhF = CreateColorPicker(VisualsLeft, "Name Hidden", Config.ESP, "NameNotVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = nhF
    nhF.Visible = Config.ESP.VisibilityCheck
    CreateToggle(VisualsLeft, "Health", Config.ESP, "Health")
    CreateToggle(VisualsLeft, "Custom HP Color", Config.ESP, "HealthBarCustom")
    CreateColorPicker(VisualsLeft, "HP Bar Color", Config.ESP, "HealthBarColor")
    CreateToggle(VisualsLeft, "Skeleton", Config.ESP, "Skeleton")
    CreateSlider(VisualsLeft, "Skeleton Thickness", 1, 5, Config.ESP, "SkeletonThickness")
    CreateColorPicker(VisualsLeft, "Skeleton Color", Config.ESP, "SkeletonColor")
    local svF = CreateColorPicker(VisualsLeft, "Skeleton Visible", Config.ESP, "SkeletonVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = svF
    svF.Visible = Config.ESP.VisibilityCheck
    local shF = CreateColorPicker(VisualsLeft, "Skeleton Hidden", Config.ESP, "SkeletonNotVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = shF
    shF.Visible = Config.ESP.VisibilityCheck
    CreateToggle(VisualsLeft, "Head Dot", Config.ESP, "HeadDot")
    CreateColorPicker(VisualsLeft, "Dot Color", Config.ESP, "HeadDotColor")
    local dvF = CreateColorPicker(VisualsLeft, "Dot Visible", Config.ESP, "HeadDotVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = dvF
    dvF.Visible = Config.ESP.VisibilityCheck
    local dhF = CreateColorPicker(VisualsLeft, "Dot Hidden", Config.ESP, "HeadDotNotVisibleColor")
    visCheckFrames[#visCheckFrames + 1] = dhF
    dhF.Visible = Config.ESP.VisibilityCheck
    CreateToggle(VisualsLeft, "Highlight", Config.ESP, "Highlight")
    CreateColorPicker(VisualsLeft, "HL Fill", Config.ESP, "HighlightFill")
    CreateColorPicker(VisualsLeft, "HL Outline", Config.ESP, "HighlightOutline")
    local hvF = CreateColorPicker(VisualsLeft, "HL Visible Fill", Config.ESP, "HighlightVisibleFill")
    visCheckFrames[#visCheckFrames + 1] = hvF
    hvF.Visible = Config.ESP.VisibilityCheck
    local hhF = CreateColorPicker(VisualsLeft, "HL Hidden Fill", Config.ESP, "HighlightHiddenFill")
    visCheckFrames[#visCheckFrames + 1] = hhF
    hhF.Visible = Config.ESP.VisibilityCheck
    CreateToggle(VisualsLeft, "Distance", Config.ESP, "Distance")
    CreateColorPicker(VisualsLeft, "Distance Color", Config.ESP, "DistanceColor")
    CreateToggle(VisualsLeft, "Current Weapon", Config.ESP.CurrentWeapon, "Enabled")
    CreateColorPicker(VisualsLeft, "Weapon Color", Config.ESP.CurrentWeapon, "Color")
    CreateButton(VisualsLeft, "Reset ESP", function() 
        for plr, e in pairs(ESP_.Players) do 
            DestroyPlayerESP(e)
            ESP_.Players[plr] = nil 
        end
        for _, p in pairs(Players:GetPlayers()) do 
            if p ~= LP then 
                ESP_.Players[p] = CreatePlayerESP() 
            end 
        end 
    end)
    CreateToggle(VisualsLeft, "Charms", Config.Charms, "Enabled", function(v) 
        if not v then 
            for plr, parts in pairs(CharmCache) do 
                for _, box in pairs(parts) do pcall(function() box:Destroy() end) end
                CharmCache[plr] = nil 
            end
            CharmVisCache = {} 
        end 
    end)
    CreateToggle(VisualsLeft, "Charms Team Check", Config.Charms, "TeamCheck", function(v) 
        for plr, parts in pairs(CharmCache) do 
            if v and not is_enemy(plr) then 
                for _, box in pairs(parts) do pcall(function() box:Destroy() end) end
                CharmCache[plr] = nil
                CharmVisCache[plr] = nil 
            end 
        end 
    end)
    CreateColorPicker(VisualsLeft, "Charms Visible", Config.Charms, "VisibleColor")
    CreateColorPicker(VisualsLeft, "Charms Hidden", Config.Charms, "HiddenColor")
    CreateSlider(VisualsLeft, "Charms Transparency", 0, 1, Config.Charms, "Transparency")
    CreateToggle(VisualsLeft, "Charms Always On Top", Config.Charms, "AlwaysOnTop")

    CreateLabel(VisualsRight, "world esp", 14, Enum.TextXAlignment.Center)
    CreateToggle(VisualsRight, "Dropped Weapons", Config.ESP.DroppedWeapons, "Enabled")
    CreateToggle(VisualsRight, "Dropped Box", Config.ESP.DroppedWeapons, "Box")
    CreateToggle(VisualsRight, "Dropped Highlight", Config.ESP.DroppedWeapons, "Highlight")
    CreateToggle(VisualsRight, "Dropped Name", Config.ESP.DroppedWeapons, "Name")
    CreateColorPicker(VisualsRight, "Dropped Color", Config.ESP.DroppedWeapons, "Color")
    CreateToggle(VisualsRight, "Bomb", Config.ESP.Bomb, "Enabled")
    CreateToggle(VisualsRight, "Bomb Box", Config.ESP.Bomb, "Box")
    CreateToggle(VisualsRight, "Bomb Highlight", Config.ESP.Bomb, "Highlight")
    CreateToggle(VisualsRight, "Bomb Name", Config.ESP.Bomb, "Name")
    CreateColorPicker(VisualsRight, "Bomb Color", Config.ESP.Bomb, "Color")
    CreateToggle(VisualsRight, "Fire ESP", Config.ESP.Molotovs, "Enabled")
    CreateToggle(VisualsRight, "Fire Highlight", Config.ESP.Molotovs, "Highlight")
    CreateColorPicker(VisualsRight, "Fire Color", Config.ESP.Molotovs, "Color")
    CreateToggle(VisualsRight, "Smoke ESP", Config.ESP.Smokes, "Enabled")
    CreateToggle(VisualsRight, "Smoke Highlight", Config.ESP.Smokes, "Highlight")
    CreateColorPicker(VisualsRight, "Smoke Color", Config.ESP.Smokes, "Color")
end
SetupVisualsTab()

local function SetupMovementTab()
    CreateToggle(MovementTab, "Auto Bhop", Config, "AutoBhop")
    CreateKeybind(MovementTab, "Bhop Key", Config, "BhopKey")

    CreateToggle(MovementTab, "JumpBug Enabled", Config.JumpBug, "Enabled")
    CreateSlider(MovementTab, "JB Power", 0.5, 3, Config.JumpBug, "Power")
    CreateSingleDropdown(MovementTab, "JB Mode", {"Always", "Toggle", "Hold"}, Config.JumpBug, "Mode")
    CreateKeybind(MovementTab, "JB Key", Config.JumpBug, "Key")

    CreateToggle(MovementTab, "EdgeBug Enabled", Config.EdgeBug, "Enabled")
    CreateSlider(MovementTab, "EB Max Duration", 0.5, 5, Config.EdgeBug, "MaxDuration")
    CreateSlider(MovementTab, "EB Range", 2, 20, Config.EdgeBug, "Range")
    CreateSingleDropdown(MovementTab, "EB Mode", {"Always", "Toggle", "Hold"}, Config.EdgeBug, "Mode")
    CreateKeybind(MovementTab, "EB Key", Config.EdgeBug, "Key")

    CreateToggle(MovementTab, "JB/EB Indicator", Config, "JBEBIndicator")
    CreateColorPicker(MovementTab, "JB Color", Config, "JBColor")
    CreateColorPicker(MovementTab, "EB Color", Config, "EBColor")

    CreateToggle(MovementTab, "Movement Display", Config.MovementDisplay, "Enabled")
    CreateColorPicker(MovementTab, "Display Color", Config.MovementDisplay, "Color")
    CreateToggle(MovementTab, "Speed Graph", Config.Graph, "Enabled")
    CreateToggle(MovementTab, "Show Peak Velocity", Config.Graph, "PeakEnabled")
    CreateColorPicker(MovementTab, "Graph Color", Config.Graph, "Color")
    CreateSlider(MovementTab, "Graph Max Speed", 10, 200, Config.Graph, "MaxSpeed")
end
SetupMovementTab()

local function SetupMiscTab()
    CreateToggle(MiscTab, "Watermark", Config, "Watermark", function(v) WatermarkFrame.Visible = v end)
    CreateToggle(MiscTab, "Keybind List", Config, "ShowKeybinds")
    CreateToggle(MiscTab, "Spectator List", Config, "SpectatorList")
    CreateToggle(MiscTab, "Flash Remover", Config, "FlashRemover")
    CreateToggle(MiscTab, "Smoke Remover", Config, "SmokeRemover")
    CreateToggle(MiscTab, "Anti-Aim", Config.AntiAim, "Enabled")
    CreateSlider(MiscTab, "AA Yaw Offset", 0, 360, Config.AntiAim, "YawOffset")
    CreateSlider(MiscTab, "AA Jitter", 0, 180, Config.AntiAim, "JitterRange")

    if G.knifeChangerSupported then
    else
        CreateLabel(MiscTab, "Your executor " .. G.executor .. " does not support Grenade Prediction", 12, Enum.TextXAlignment.Center)
    end
end
SetupMiscTab()

local function ShowInspectWarning(cb)
    if G.inspectWarningShown then cb() return end
    local wg = Instance.new("ScreenGui")
    wg.Name = "InspectWarn"
    wg.IgnoreGuiInset = true
    wg.Parent = Parent

    local bg = Instance.new("Frame", wg)
    bg.Size = UDim2.new(1, 0, 1, 0)
    bg.BackgroundColor3 = Color3.new(0, 0, 0)
    bg.BackgroundTransparency = 0.5

    local fr = Instance.new("Frame", bg)
    fr.Size = UDim2.new(0, 350, 0, 150)
    fr.Position = UDim2.new(0.5, -175, 0.5, -75)
    fr.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
    fr.BorderSizePixel = 0
    Instance.new("UICorner", fr).CornerRadius = UDim.new(0, 8)

    local tl = Instance.new("TextLabel", fr)
    tl.Size = UDim2.new(1, -20, 0, 80)
    tl.Position = UDim2.new(0, 10, 0, 10)
    tl.BackgroundTransparency = 1
    tl.Text = "Do not use this while in match or choosing team, use this only on menu. Do you want to continue?"
    tl.TextColor3 = Color3.new(1, 1, 1)
    tl.Font = Enum.Font.GothamBold
    tl.TextSize = 13
    tl.TextWrapped = true

    local yb = Instance.new("TextButton", fr)
    yb.Size = UDim2.new(0, 100, 0, 30)
    yb.Position = UDim2.new(0.25, -50, 0, 100)
    yb.Text = "Yes"
    yb.BackgroundColor3 = Color3.fromRGB(0, 180, 0)
    yb.TextColor3 = Color3.new(1, 1, 1)
    yb.Font = Enum.Font.GothamBold
    yb.TextSize = 14
    Instance.new("UICorner", yb).CornerRadius = UDim.new(0, 6)

    local nb = Instance.new("TextButton", fr)
    nb.Size = UDim2.new(0, 100, 0, 30)
    nb.Position = UDim2.new(0.75, -50, 0, 100)
    nb.Text = "No"
    nb.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
    nb.TextColor3 = Color3.new(1, 1, 1)
    nb.Font = Enum.Font.GothamBold
    nb.TextSize = 14
    Instance.new("UICorner", nb).CornerRadius = UDim.new(0, 6)

    yb.MouseButton1Down:Connect(function() 
        G.inspectWarningShown = true
        wg:Destroy()
        cb() 
    end)
    nb.MouseButton1Down:Connect(function() wg:Destroy() end)
end

local function addInspectButton(parentDD, wName, isGlove)
    local inspBtn = Instance.new("TextButton")
    inspBtn.Size = UDim2.new(0, 20, 0, 18)
    inspBtn.Position = UDim2.new(1, -25, 0, 18)
    inspBtn.Text = "?"
    inspBtn.Font = Enum.Font.Arial
    inspBtn.TextSize = 12
    inspBtn.BackgroundColor3 = CurrentTheme.Item
    inspBtn.TextColor3 = CurrentTheme.Text
    inspBtn.BorderSizePixel = 0
    inspBtn.Parent = parentDD

    inspBtn.MouseButton1Down:Connect(function()
        ShowInspectWarning(function()
            if isGlove then
                local sk = Config.GloveChanger.Gloves[wName]
                if sk and sk ~= "Default" then inspectWeapon(wName, sk, 0.007) end
            else
                local sk = Config.SkinChanger.Skins[wName]
                if sk and sk ~= "Default" then inspectWeapon(wName, sk, 0.007) end
            end
        end)
    end)
end

local function SetupSkinChangerTab()
    CreateLabel(SkinLeft, "weapon skins", 14, Enum.TextXAlignment.Center)
    CreateToggle(SkinLeft, "Enable Skins", Config.SkinChanger, "Enabled")

    local KM = {"Karambit", "Butterfly Knife", "Flip Knife", "Gut Knife", "M9 Bayonet"}
    local EW = {"Driver Gloves", "Sports Gloves", "Operator Gloves", "Hand Wraps"}

    for w, s in pairs(SD.SkinSelections) do
        if not table.find(KM, w) and not table.find(EW, w) then
            local dd = CreateSingleDropdown(SkinLeft, w, s, Config.SkinChanger.Skins, w, function() pcall(ApplySkin) end)
            addInspectButton(dd, w, false)
        end
    end

    CreateLabel(SkinRight, "glove changer", 14, Enum.TextXAlignment.Center)
    CreateToggle(SkinRight, "Enable Gloves", Config.GloveChanger, "Enabled")

    if G.knifeChangerSupported then
        local GM = {}
        for k in pairs(SD.GloveSelections) do GM[#GM + 1] = k end
        table.sort(GM)
        local GSD = {}
        local function UGSV(m) 
            for k, d in pairs(GSD) do d.Visible = (k == m) end 
        end
        CreateSingleDropdown(SkinRight, "Glove Model", GM, Config.GloveChanger, "Model", function(v) UGSV(v) end)
        for _, g in ipairs(GM) do 
            local gs = SD.GloveSelections[g]
            if gs then 
                local dd = CreateSingleDropdown(SkinRight, g .. " Skin", gs, Config.GloveChanger.Gloves, g)
                dd.Visible = (Config.GloveChanger.Model == g)
                GSD[g] = dd
                addInspectButton(dd, g, true) 
            end 
        end
        UGSV(Config.GloveChanger.Model)
    else
        CreateLabel(SkinRight, "Your executor " .. G.executor .. " does not support Glove Changer hooks", 12, Enum.TextXAlignment.Center)
        for gn, gs in pairs(SD.GloveSelections) do 
            CreateSingleDropdown(SkinRight, gn, gs, Config.GloveChanger.Gloves, gn, function() pcall(ApplyGloves) end) 
        end
    end

    CreateLabel(SkinRight, "knife changer", 14, Enum.TextXAlignment.Center)

    local function InitKnifeChanger()
        local su, re = pcall(function()
            local SM = RepStore:FindFirstChild("Database") and RepStore.Database:FindFirstChild("Components") and RepStore.Database.Components:FindFirstChild("Libraries") and RepStore.Database.Components.Libraries:FindFirstChild("Skins")
            local VM = RepStore:FindFirstChild("Classes") and RepStore.Classes:FindFirstChild("WeaponComponent") and RepStore.Classes.WeaponComponent:FindFirstChild("Classes") and RepStore.Classes.WeaponComponent.Classes:FindFirstChild("Viewmodel")
            if not SM or not VM then return false end

            local Sk = SafeRequire(SM)
            local Vm = SafeRequire(VM)
            if not Sk or not Vm then return false end
            if type(Sk) ~= "table" or type(Vm) ~= "table" then return false end
            if not Sk.GetCameraModel or not Sk.GetCharacterModel or not Vm.new then return false end

            local oGCM = Sk.GetCameraModel
            Sk.GetCameraModel = function(w, sk, ...)
                local success, result
                if Config.KnifeChanger.Enabled and w and Checkknife(w) then
                    local newKnife = Config.KnifeChanger.Model
                    local newSkin = Config.SkinChanger.Skins[newKnife] or "Vanilla"
                    success, result = pcall(oGCM, newKnife, newSkin, ...)
                    if success and result then return result end
                end
                success, result = pcall(oGCM, w, sk, ...)
                if success then return result end
                return nil
            end

            local oGChM = Sk.GetCharacterModel
            Sk.GetCharacterModel = function(w, sk, ...)
                local success, result
                if Config.KnifeChanger.Enabled and w and Checkknife(w) then
                    local newKnife = Config.KnifeChanger.Model
                    local newSkin = Config.SkinChanger.Skins[newKnife] or "Vanilla"
                    success, result = pcall(oGChM, newKnife, newSkin, ...)
                    if success and result then return result end
                end
                success, result = pcall(oGChM, w, sk, ...)
                if success then return result end
                return nil
            end

            local oVN = Vm.new
            Vm.new = function(vc, w, sk, ...)
                local success, result
                if Config.KnifeChanger.Enabled and w and Checkknife(w) then
                    local newKnife = Config.KnifeChanger.Model
                    local newSkin = Config.SkinChanger.Skins[newKnife] or "Vanilla"
                    success, result = pcall(oVN, vc, newKnife, newSkin, ...)
                    if success and result then return result end
                end
                success, result = pcall(oVN, vc, w, sk, ...)
                if success then return result end
                return nil
            end

            if Sk.GetGloves then
                local oGG = Sk.GetGloves
                Sk.GetGloves = function(g, sk)
                    local success, result
                    if Config.GloveChanger.Enabled and Config.GloveChanger.Model then
                        local gModel = Config.GloveChanger.Model
                        local ts = Config.GloveChanger.Gloves[gModel] or "Vanilla"
                        success, result = pcall(oGG, gModel, ts)
                        if success and result then return result end
                    end
                    success, result = pcall(oGG, g, sk)
                    if success then return result end
                    return nil
                end
            end
            return true
        end)
        return su and re
    end

    if G.knifeChangerSupported then
        local init = InitKnifeChanger()
        if init then
            CreateToggle(SkinRight, "Knife Changer", Config.KnifeChanger, "Enabled")
            local KSD2 = {}
            local function UKSV(m) 
                for k, d in pairs(KSD2) do d.Visible = (k == m) end 
            end
            CreateSingleDropdown(SkinRight, "Knife Model (next round)", KM, Config.KnifeChanger, "Model", function(v) UKSV(v) pcall(ApplySkin) end)
            for _, kn in ipairs(KM) do 
                local ks = SD.SkinSelections[kn]
                if ks then 
                    local dd = CreateSingleDropdown(SkinRight, kn .. " Skin", ks, Config.SkinChanger.Skins, kn, function() pcall(ApplySkin) end)
                    dd.Visible = (Config.KnifeChanger.Model == kn)
                    KSD2[kn] = dd
                    addInspectButton(dd, kn, false) 
                end 
            end
        else 
            CreateLabel(SkinRight, "Your executor " .. G.executor .. " does not support Knife Changer", 12, Enum.TextXAlignment.Center) 
        end
    else 
        CreateLabel(SkinRight, "Your executor " .. G.executor .. " does not support Knife Changer", 12, Enum.TextXAlignment.Center) 
    end
end
SetupSkinChangerTab()

local function Ser(tbl)
    local r = {}
    for k, sv in pairs(tbl) do
        if type(sv) == "table" then
            r[k] = Ser(sv)
        elseif typeof(sv) == "Color3" then
            r[k] = {Type = "Color3", R = sv.R, G = sv.G, B = sv.B}
        elseif typeof(sv) == "Vector3" then
            r[k] = {Type = "Vector3", X = sv.X, Y = sv.Y, Z = sv.Z}
        elseif typeof(sv) == "EnumItem" then
            r[k] = {Type = "Enum", EnumType = tostring(sv.EnumType), Name = sv.Name}
        else
            r[k] = sv
        end
    end
    return r
end

local function Des(tbl, ct)
    for k, dv in pairs(tbl) do
        if type(dv) == "table" and dv.Type then
            if dv.Type == "Color3" then
                ct[k] = Color3.new(dv.R, dv.G, dv.B)
            elseif dv.Type == "Vector3" then
                ct[k] = Vector3.new(dv.X, dv.Y, dv.Z)
            elseif dv.Type == "Enum" then
                local et = tostring(dv.EnumType):match("Enum%.(%w+)")
                if et and Enum[et] and Enum[et][dv.Name] then
                    ct[k] = Enum[et][dv.Name]
                end
            end
        elseif type(dv) == "table" and type(ct[k]) == "table" then
            Des(dv, ct[k])
        elseif ct[k] ~= nil then
            ct[k] = dv
        end
    end
end

local function SetupSettingsTab()
    CreateToggle(SettingsLeft, "Debug Mode", Config, "Debug")
    CreateSingleDropdown(SettingsLeft, "Theme", {"Default", "Dark", "Light", "Blood", "Ocean", "Forest", "Midnight", "Sunset"}, Config, "Theme", function(v) 
        if Themes[v] then 
            CurrentTheme = Themes[v]
            RefreshTheme() 
        end 
    end)

    UIE.DiscordBtn.MouseButton1Click:Connect(function() JoinDiscord() end)
    CreateButton(SettingsLeft, "Discord", function() JoinDiscord() end)
    CreateButton(SettingsLeft, "Reset Config", function() 
        local function RU(t, src) 
            for k, rv in pairs(src) do 
                if type(rv) == "table" and type(t[k]) == "table" then RU(t[k], rv) 
                else t[k] = rv end 
            end 
        end
        RU(Config, DefaultConfig)
        RefreshUI() 
    end)

    CreateLabel(SettingsRight, "-- File Config System --", 14, Enum.TextXAlignment.Center)

    local isVelocity = string.find(G.executor, "Velocity", 1, true)
    if not isVelocity and G.hasFileSystem then
        local CONFIG_DIR = "bankroll_configs"
        pcall(function() 
            if makefolder and not isfolder(CONFIG_DIR) then makefolder(CONFIG_DIR) end 
        end)

        local selectedConfig = {Name = nil}
        local configListFrame = nil
        local configButtons = {}

        local nameInputFrame = Instance.new("Frame")
        nameInputFrame.Size = UDim2.new(1, 0, 0, 30)
        nameInputFrame.BackgroundTransparency = 1
        nameInputFrame.Parent = SettingsRight

        local nameInput = Instance.new("TextBox")
        nameInput.Size = UDim2.new(1, -10, 0, 24)
        nameInput.Position = UDim2.new(0, 5, 0, 3)
        nameInput.PlaceholderText = "Config name..."
        nameInput.Text = ""
        nameInput.Font = Enum.Font.Arial
        nameInput.TextSize = 13
        nameInput.ClearTextOnFocus = false
        nameInput.Parent = nameInputFrame
        AddThemeObject(nameInput, "Item")
        AddThemeObject(nameInput, "Text")
        Instance.new("UICorner", nameInput).CornerRadius = UDim.new(0, 4)

        local function GetConfigList() 
            local list = {}
            pcall(function() 
                if listfiles then 
                    for _, f in pairs(listfiles(CONFIG_DIR)) do 
                        local name = f:match("([^/\\]+)%.json$")
                        if name then list[#list + 1] = name end 
                    end 
                end 
            end)
            table.sort(list)
            return list 
        end

        local function RefreshConfigList()
            if not configListFrame then return end
            for _, btn in pairs(configButtons) do pcall(function() btn:Destroy() end) end
            table.clear(configButtons)

            local configs = GetConfigList()
            for _, name in ipairs(configs) do
                local btn = Instance.new("TextButton")
                btn.Size = UDim2.new(1, -4, 0, 22)
                btn.Text = name
                btn.Font = Enum.Font.Arial
                btn.TextSize = 12
                btn.BackgroundColor3 = (selectedConfig.Name == name) and CurrentTheme.Accent or CurrentTheme.Item
                btn.TextColor3 = CurrentTheme.Text
                btn.BorderSizePixel = 0
                btn.Parent = configListFrame
                Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 3)
                btn.MouseButton1Down:Connect(function() 
                    selectedConfig.Name = name
                    RefreshConfigList() 
                end)
                configButtons[#configButtons + 1] = btn
            end
            configListFrame.CanvasSize = UDim2.new(0, 0, 0, #configs * 24)
        end

        CreateButton(SettingsRight, "Save Config", function()
            local name = nameInput.Text
            if name == "" or not name:match("%S") then return end
            name = name:gsub("[^%w%s%-_%.]", ""):sub(1, 30)
            if name == "" then return end
            pcall(function() 
                if writefile then 
                    local s, d = pcall(Ser, Config)
                    if s then 
                        writefile(CONFIG_DIR .. "/" .. name .. ".json", HS:JSONEncode(d))
                        nameInput.Text = ""
                        RefreshConfigList() 
                    end 
                end 
            end)
        end)

        CreateLabel(SettingsRight, "Saved Configs:", 13, Enum.TextXAlignment.Left)

        configListFrame = Instance.new("ScrollingFrame")
        configListFrame.Size = UDim2.new(1, -10, 0, 100)
        configListFrame.Position = UDim2.new(0, 5, 0, 0)
        configListFrame.BackgroundColor3 = CurrentTheme.Item
        configListFrame.BorderSizePixel = 0
        configListFrame.ScrollBarThickness = 3
        configListFrame.AutomaticCanvasSize = Enum.AutomaticSize.None
        configListFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
        AddThemeObject(configListFrame, "Item")
        Instance.new("UICorner", configListFrame).CornerRadius = UDim.new(0, 4)

        local cll = Instance.new("UIListLayout", configListFrame)
        cll.Padding = UDim.new(0, 2)
        cll.SortOrder = Enum.SortOrder.LayoutOrder

        local clp = Instance.new("UIPadding", configListFrame)
        clp.PaddingLeft = UDim.new(0, 2)
        clp.PaddingTop = UDim.new(0, 2)

        local listWrapper = Instance.new("Frame")
        listWrapper.Size = UDim2.new(1, 0, 0, 100)
        listWrapper.BackgroundTransparency = 1
        listWrapper.Parent = SettingsRight
        configListFrame.Parent = listWrapper

        CreateButton(SettingsRight, "Load Selected", function()
            if not selectedConfig.Name then return end
            pcall(function() 
                if readfile then 
                    local s, c = pcall(readfile, CONFIG_DIR .. "/" .. selectedConfig.Name .. ".json")
                    if s and c then 
                        local ds, d = pcall(function() return HS:JSONDecode(c) end)
                        if ds and d then 
                            pcall(Des, d, Config)
                            RefreshUI()
                            if Config.Theme and Themes[Config.Theme] then 
                                CurrentTheme = Themes[Config.Theme]
                                RefreshTheme() 
                            end
                            pcall(function() WatermarkFrame.Visible = Config.Watermark end) 
                        end 
                    end 
                end 
            end)
        end)

        CreateButton(SettingsRight, "Overwrite Selected", function() 
            if not selectedConfig.Name then return end
            pcall(function() 
                if writefile then 
                    local s, d = pcall(Ser, Config)
                    if s then writefile(CONFIG_DIR .. "/" .. selectedConfig.Name .. ".json", HS:JSONEncode(d)) end 
                end 
            end) 
        end)

        CreateButton(SettingsRight, "Delete Selected", function() 
            if not selectedConfig.Name then return end
            pcall(function() 
                if delfile then 
                    delfile(CONFIG_DIR .. "/" .. selectedConfig.Name .. ".json") 
                end
                selectedConfig.Name = nil
                RefreshConfigList() 
            end) 
        end)

        CreateButton(SettingsRight, "Refresh List", function() RefreshConfigList() end)

        task.defer(function() RefreshConfigList() end)
    else
        if isVelocity then
            CreateLabel(SettingsRight, "Config system not supported", 13, Enum.TextXAlignment.Center)
            CreateLabel(SettingsRight, "(Velocity executor)", 12, Enum.TextXAlignment.Center)
        else
            CreateLabel(SettingsRight, "File system not available", 13, Enum.TextXAlignment.Center)
        end
    end

    CreateLabel(SettingsRight, "-- Import/Export Code (broken rn)--", 14, Enum.TextXAlignment.Center)

    local codeFrame = Instance.new("Frame")
    codeFrame.Size = UDim2.new(1, 0, 0, 70)
    codeFrame.BackgroundTransparency = 1
    codeFrame.Parent = SettingsRight

    local codeBox = Instance.new("TextBox")
    codeBox.Size = UDim2.new(1, -10, 0, 65)
    codeBox.Position = UDim2.new(0, 5, 0, 3)
    codeBox.PlaceholderText = "Paste config code here..."
    codeBox.Text = ""
    codeBox.Font = Enum.Font.Code
    codeBox.TextSize = 9
    codeBox.ClearTextOnFocus = false
    codeBox.MultiLine = true
    codeBox.TextWrapped = true
    codeBox.TextYAlignment = Enum.TextYAlignment.Top
    codeBox.Parent = codeFrame
    AddThemeObject(codeBox, "Item")
    AddThemeObject(codeBox, "Text")
    Instance.new("UICorner", codeBox).CornerRadius = UDim.new(0, 4)

    CreateButton(SettingsRight, "Import Code", function()
        local code = codeBox.Text:gsub("%s+", "")
        if #code < 10 then 
            codeBox.Text = "Code too short!"
            task.delay(2, function() codeBox.Text = "" end)
            return 
        end
        local ok = pcall(function()
            local decoded = nil
            local success = pcall(function() decoded = HS:JSONDecode(code) end)
            if success and decoded and type(decoded) == "table" then
                pcall(Des, decoded, Config)
                RefreshUI()
                if Config.Theme and Themes[Config.Theme] then CurrentTheme = Themes[Config.Theme] RefreshTheme() end
                pcall(function() WatermarkFrame.Visible = Config.Watermark end)
                codeBox.Text = "Imported!"
            else
                codeBox.Text = "Invalid code!"
            end
        end)
        if not ok then codeBox.Text = "Import failed!" end
        task.delay(2, function() 
            if codeBox.Text == "Imported!" or codeBox.Text == "Invalid code!" or codeBox.Text == "Import failed!" then 
                codeBox.Text = "" 
            end 
        end)
    end)

    CreateButton(SettingsRight, "Export Code", function()
        local ok, serialized = pcall(Ser, Config)
        if ok then
            local success, encoded = pcall(function() return HS:JSONEncode(serialized) end)
            if success and encoded then
                codeBox.Text = encoded
                pcall(function() if setclipboard then setclipboard(encoded) end end)
            else
                codeBox.Text = "Export failed!"
                task.delay(2, function() codeBox.Text = "" end)
            end
        else
            codeBox.Text = "Serialization failed!"
            task.delay(2, function() codeBox.Text = "" end)
        end
    end)

    CreateButton(SettingsRight, "Copy to Clipboard", function()
        if codeBox.Text ~= "" and not codeBox.Text:find("failed") and not codeBox.Text:find("Imported") and not codeBox.Text:find("short") and not codeBox.Text:find("Invalid") then
            pcall(function() if setclipboard then setclipboard(codeBox.Text) end end)
            local oldText = codeBox.Text
            codeBox.Text = "Copied!"
            task.delay(1, function() codeBox.Text = oldText end)
        end
    end)

    CreateButton(SettingsRight, "Clear", function() codeBox.Text = "" end)
end
SetupSettingsTab()

local Camera = workspace.CurrentCamera

local Circle
pcall(function()
    local c = Drawing.new("Circle")
    if c and type(c) ~= "number" then
        c.Thickness = 1.6
        c.Color = Color3.fromRGB(255, 255, 255)
        c.Filled = false
        c.Transparency = 0.7
        AD(c)
        Circle = c
    end
end)

local RP_ = {aimbot = RaycastParams.new(), trigger = RaycastParams.new(), esp = RaycastParams.new(), aa = RaycastParams.new()}
RP_.aimbot.FilterType = Enum.RaycastFilterType.Exclude
RP_.trigger.FilterType = Enum.RaycastFilterType.Exclude
RP_.esp.FilterType = Enum.RaycastFilterType.Exclude
RP_.esp.IgnoreWater = true
RP_.aa.FilterType = Enum.RaycastFilterType.Exclude

local function IsVisible(part)
    if not part then return false end
    local o = Camera.CFrame.Position
    local d = (part.Position - o).Unit * 1000
    pcall(function() RP_.aimbot.FilterDescendantsInstances = {G.LocalCharacter} end)
    local r = workspace:Raycast(o, d, RP_.aimbot)
    if r then
        local hi
        pcall(function() hi = r.Instance end)
        if hi and part.Parent then
            local id = false
            pcall(function() id = hi:IsDescendantOf(part.Parent) end)
            return id
        end
        return false
    end
    return true
end

local espF = {nil, nil}

local function ESP_IsVisible(char, pos)
    if not G.LocalCharacter or not char or not char.Parent then return true end
    local op = G.LocalCharacter:FindFirstChild("Head") or G.LocalCharacter.PrimaryPart or G.LocalCharacter:FindFirstChild("HumanoidRootPart")
    if not op then return true end
    local o = op.Position
    espF[1] = G.LocalCharacter
    espF[2] = char
    pcall(function() RP_.esp.FilterDescendantsInstances = espF end)
    for _, nm in ipairs({"Head", "HumanoidRootPart"}) do
        local pt = char:FindFirstChild(nm)
        if pt and pt:IsA("BasePart") then
            local dr = pt.Position - o
            if dr.Magnitude > 1 then
                if not workspace:Raycast(o, dr.Unit * (dr.Magnitude - 0.5), RP_.esp) then return true end
            end
        end
    end
    return false
end

local function GetColor(base, vis, nvis, visible)
    if Config.ESP.VisibilityCheck then return visible and vis or nvis end
    return base
end

RunOnActor(function()
    task.spawn(function()
        while true do
            if Config.ESP.Enabled then
                for plr, e in pairs(ESP_.Players) do
                    pcall(function()
                        local ch = plr.Character
                        if not ch or not ch.Parent then e.Valid = false return end
                        local rt = ch:FindFirstChild("HumanoidRootPart") or ch.PrimaryPart
                        local hm = ch:FindFirstChildWhichIsA("Humanoid")
                        if not rt or not hm or hm.Health <= 0 then e.Valid = false return end
                        if Config.ESP.TeamCheck and not is_enemy(plr) then e.Valid = false return end
                        e.Root = rt
                        e.HeadPart = ch:FindFirstChild("Head")
                        e.Hum = hm
                        e.Char = ch
                        e.Valid = true
                    end)
                end
            end
            task.wait(0.5)
        end
    end)
end)

local V2 = Vector2.new
local V3 = Vector3.new

local function Draw2DBox(eo, center, size, col, show)
    local hw = size.X / 2
    local hh = size.Y / 2
    local tl = V2(center.X - hw, center.Y - hh)
    local tr = V2(center.X + hw, center.Y - hh)
    local bl = V2(center.X - hw, center.Y + hh)
    local br = V2(center.X + hw, center.Y + hh)

    if show then
        if eo.Box[1] and type(eo.Box[1]) ~= "number" then eo.Box[1].From = tl eo.Box[1].To = tr eo.Box[1].Color = col eo.Box[1].Visible = true end
        if eo.Box[2] and type(eo.Box[2]) ~= "number" then eo.Box[2].From = tr eo.Box[2].To = br eo.Box[2].Color = col eo.Box[2].Visible = true end
        if eo.Box[3] and type(eo.Box[3]) ~= "number" then eo.Box[3].From = br eo.Box[3].To = bl eo.Box[3].Color = col eo.Box[3].Visible = true end
        if eo.Box[4] and type(eo.Box[4]) ~= "number" then eo.Box[4].From = bl eo.Box[4].To = tl eo.Box[4].Color = col eo.Box[4].Visible = true end
    else
        for i = 1, 4 do 
            if eo.Box[i] and type(eo.Box[i]) ~= "number" then eo.Box[i].Visible = false end 
        end
    end
    return tl
end

local function GetFolderRadius(folder)
    if not folder or not folder:IsA("Folder") then return 0 end
    local minX, minZ, maxX, maxZ = math.huge, math.huge, -math.huge, -math.huge
    local count = 0
    for _, child in pairs(folder:GetChildren()) do
        if child:IsA("BasePart") then
            local p = child.Position
            local s = child.Size
            minX = math.min(minX, p.X - s.X / 2)
            maxX = math.max(maxX, p.X + s.X / 2)
            minZ = math.min(minZ, p.Z - s.Z / 2)
            maxZ = math.max(maxZ, p.Z + s.Z / 2)
            count = count + 1
        end
    end
    if count == 0 then return 0 end
    return math.max(maxX - minX, maxZ - minZ) / 2
end

local function GetFolderCenter(folder)
    if not folder or not folder:IsA("Folder") then return nil end
    local sum = V3(0, 0, 0)
    local count = 0
    for _, child in pairs(folder:GetChildren()) do
        if child:IsA("BasePart") then
            sum = sum + child.Position
            count = count + 1
        end
    end
    if count == 0 then return nil end
    return sum / count
end

local function UpdateWorldESP()
    if not Camera then HideAllWorldESP() return end
    local ch = G.LocalCharacter
    local hm = ch and ch:FindFirstChildWhichIsA("Humanoid")
    if not ch or not hm or hm.Health <= 0 then HideAllWorldESP() return end

    local wtvp = Camera.WorldToViewportPoint

    if Config.ESP.DroppedWeapons.Enabled then
        for item, eo in pairs(WorldESP.DroppedWeapons) do
            if not item or not item.Parent or not item.PrimaryPart then HideWorldESPObject(eo) continue end
            local pp = item.PrimaryPart
            local pos, on = wtvp(Camera, pp.Position)
            if not on or pos.Z <= 0 then HideWorldESPObject(eo) continue end
            Draw2DBox(eo, V2(pos.X, pos.Y), V2(30, 20), Config.ESP.DroppedWeapons.Color, Config.ESP.DroppedWeapons.Box)
            if eo.Name and type(eo.Name) ~= "number" then
                if Config.ESP.DroppedWeapons.Name then
                    eo.Name.Text = item:GetAttribute("Weapon") or "Weapon"
                    eo.Name.Size = 13
                    eo.Name.Position = V2(pos.X, pos.Y - 25)
                    eo.Name.Color = Config.ESP.DroppedWeapons.Color
                    eo.Name.Visible = true
                else eo.Name.Visible = false end
            end
            if eo.HL then 
                eo.HL.Adornee = item
                eo.HL.FillColor = Config.ESP.DroppedWeapons.Color
                eo.HL.OutlineColor = G.C3W
                eo.HL.Enabled = Config.ESP.DroppedWeapons.Highlight 
            end
        end
    else 
        for _, eo in pairs(WorldESP.DroppedWeapons) do HideWorldESPObject(eo) end 
    end

    if Config.ESP.Bomb.Enabled and WorldESP.Bomb and WorldESP.Bomb.Model and WorldESP.Bomb.Model.PrimaryPart then
        local eo = WorldESP.Bomb
        local item = eo.Model
        local cf, sz = item:GetBoundingBox()
        local pos, on = wtvp(Camera, cf.Position)
        if on and pos.Z > 0 then
            local topS = wtvp(Camera, cf.Position + V3(0, sz.Y / 2, 0))
            local botS = wtvp(Camera, cf.Position - V3(0, sz.Y / 2, 0))
            local sH = math.clamp(math.abs(topS.Y - botS.Y), 10, 80)
            Draw2DBox(eo, V2(pos.X, (topS.Y + botS.Y) / 2), V2(math.clamp(sH * 0.8, 10, 60), sH), Config.ESP.Bomb.Color, Config.ESP.Bomb.Box)
            if eo.Name and type(eo.Name) ~= "number" then
                if Config.ESP.Bomb.Name then 
                    eo.Name.Text = "C4"
                    eo.Name.Position = V2(pos.X, topS.Y - 15)
                    eo.Name.Color = Config.ESP.Bomb.Color
                    eo.Name.Visible = true
                else eo.Name.Visible = false end
            end
            if eo.HL then 
                eo.HL.Adornee = item
                eo.HL.FillColor = Config.ESP.Bomb.Color
                eo.HL.OutlineColor = G.C3W
                eo.HL.Enabled = Config.ESP.Bomb.Highlight 
            end
        else 
            HideWorldESPObject(eo) 
        end
    elseif WorldESP.Bomb then 
        HideWorldESPObject(WorldESP.Bomb) 
    end

    if Config.ESP.Molotovs.Enabled then
        for item, eo in pairs(WorldESP.Molotovs) do
            if not item or not item.Parent then HideWorldESPObject(eo) continue end
            local center = GetFolderCenter(item)
            local radius = GetFolderRadius(item)
            if center and radius > 0 then
                local pos, on = wtvp(Camera, center)
                if on and pos.Z > 0 then
                    local edgePos = wtvp(Camera, center + Camera.CFrame.RightVector * radius)
                    local screenRadius = math.clamp((V2(edgePos.X, edgePos.Y) - V2(pos.X, pos.Y)).Magnitude, 5, 200)
                    if eo.Radius and type(eo.Radius) ~= "number" then 
                        eo.Radius.Position = V2(pos.X, pos.Y)
                        eo.Radius.Radius = screenRadius
                        eo.Radius.Color = Config.ESP.Molotovs.Color
                        eo.Radius.Visible = true 
                    end
                    if eo.Name and type(eo.Name) ~= "number" then 
                        eo.Name.Text = "Fire"
                        eo.Name.Position = V2(pos.X, pos.Y - 15)
                        eo.Name.Color = Config.ESP.Molotovs.Color
                        eo.Name.Visible = true 
                    end
                else
                    if eo.Radius and type(eo.Radius) ~= "number" then eo.Radius.Visible = false end
                    if eo.Name and type(eo.Name) ~= "number" then eo.Name.Visible = false end
                end
            end
            if eo.HL then
                local fc
                for _, c in pairs(item:GetChildren()) do 
                    if c:IsA("BasePart") then fc = c break end 
                end
                if fc then 
                    eo.HL.Adornee = fc
                    eo.HL.FillColor = Config.ESP.Molotovs.Color
                    eo.HL.OutlineColor = G.C3W
                    eo.HL.Enabled = Config.ESP.Molotovs.Highlight 
                else 
                    eo.HL.Enabled = false 
                end
            end
            for i = 1, 4 do 
                if eo.Box[i] and type(eo.Box[i]) ~= "number" then eo.Box[i].Visible = false end 
            end
        end
    else 
        for _, eo in pairs(WorldESP.Molotovs) do HideWorldESPObject(eo) end 
    end

    if Config.ESP.Smokes.Enabled then
        for item, eo in pairs(WorldESP.Smokes) do
            if not item or not item.Parent then HideWorldESPObject(eo) continue end
            local center = GetFolderCenter(item)
            local radius = GetFolderRadius(item)
            if center and radius > 0 then
                local pos, on = wtvp(Camera, center)
                if on and pos.Z > 0 then
                    local edgePos = wtvp(Camera, center + Camera.CFrame.RightVector * radius)
                    local screenRadius = math.clamp((V2(edgePos.X, edgePos.Y) - V2(pos.X, pos.Y)).Magnitude, 5, 200)
                    if eo.Radius and type(eo.Radius) ~= "number" then 
                        eo.Radius.Position = V2(pos.X, pos.Y)
                        eo.Radius.Radius = screenRadius
                        eo.Radius.Color = Config.ESP.Smokes.Color
                        eo.Radius.Visible = true 
                    end
                    if eo.Name and type(eo.Name) ~= "number" then 
                        eo.Name.Text = "Smoke"
                        eo.Name.Position = V2(pos.X, pos.Y - 15)
                        eo.Name.Color = Config.ESP.Smokes.Color
                        eo.Name.Visible = true 
                    end
                else
                    if eo.Radius and type(eo.Radius) ~= "number" then eo.Radius.Visible = false end
                    if eo.Name and type(eo.Name) ~= "number" then eo.Name.Visible = false end
                end
            end
            if eo.HL then
                local fc
                for _, c in pairs(item:GetChildren()) do 
                    if c:IsA("BasePart") then fc = c break end 
                end
                if fc then 
                    eo.HL.Adornee = fc
                    eo.HL.FillColor = Config.ESP.Smokes.Color
                    eo.HL.OutlineColor = G.C3W
                    eo.HL.Enabled = Config.ESP.Smokes.Highlight 
                else 
                    eo.HL.Enabled = false 
                end
            end
            for i = 1, 4 do 
                if eo.Box[i] and type(eo.Box[i]) ~= "number" then eo.Box[i].Visible = false end 
            end
        end
    else 
        for _, eo in pairs(WorldESP.Smokes) do HideWorldESPObject(eo) end 
    end
end

local function UpdateESP()
    if not Camera or not Config.ESP.Enabled then return end
    if tick() - G.LastESPUpdate < 0.016 then return end
    G.LastESPUpdate = tick()

    local wtvp = Camera.WorldToViewportPoint
    local camPos = Camera.CFrame.Position
    local fillT = (math.sin(tick() * (Config.ESP.BoxFillFadeSpeed or 3)) + 1) / 2
    local fillCol = Config.ESP.BoxFillColor1:Lerp(Config.ESP.BoxFillColor2, fillT)

    for plr, e in pairs(ESP_.Players) do
        if not plr or not plr.Parent then 
            DestroyPlayerESP(e)
            ESP_.Players[plr] = nil
            continue 
        end
        if not e.Valid then HidePlayerESP(e) continue end

        local char, root, headPart, hum = e.Char, e.Root, e.HeadPart, e.Hum
        if not root or not root.Parent then HidePlayerESP(e) continue end
        if hum and hum.Health <= 0 then HidePlayerESP(e) continue end

        local dist = (camPos - root.Position).Magnitude
        if dist > Config.ESP.MaxDistance then HidePlayerESP(e) continue end

        local skip = false
        pcall(function() 
            if Camera.CameraSubject then 
                local subj = Camera.CameraSubject
                if subj == char or (subj.Parent and subj:IsDescendantOf(char)) then skip = true end 
            end 
        end)
        if skip then HidePlayerESP(e) continue end

        local rootScreen, onScreen = wtvp(Camera, root.Position)
        if not onScreen or rootScreen.Z <= 0 then HidePlayerESP(e) continue end

        local isVis = e.IsVisible
        if Config.ESP.VisibilityCheck and (tick() - e.LastVisCheck > 0.1) then 
            isVis = ESP_IsVisible(char, headPart and headPart.Position or root.Position)
            e.IsVisible = isVis
            e.LastVisCheck = tick()
        elseif not Config.ESP.VisibilityCheck then 
            isVis = true
            e.IsVisible = true 
        end

        local rP = root.Position
        local hP = headPart and headPart.Position or (rP + V3(0, 2, 0))

        local topScreen = wtvp(Camera, hP + V3(0, 1, 0))
        local botScreen = wtvp(Camera, rP - V3(0, 3, 0))
        if topScreen.Z <= 0 or botScreen.Z <= 0 then HidePlayerESP(e) continue end

        local topY, botY = topScreen.Y, botScreen.Y
        local sH = math.abs(botY - topY)
        local sW = sH * 0.55
        local cx = rootScreen.X

        local tl = V2(cx - sW / 2, topY)
        local tr = V2(cx + sW / 2, topY)
        local bl = V2(cx - sW / 2, botY)
        local br = V2(cx + sW / 2, botY)

        if Config.ESP.Box then
            local col = GetColor(Config.ESP.BoxColor, Config.ESP.BoxVisibleColor, Config.ESP.BoxNotVisibleColor, isVis)
            for i = 1, 4 do 
                if e.Box[i] and type(e.Box[i]) ~= "number" then e.Box[i].Thickness = Config.ESP.BoxThickness end 
            end
            if e.Box[1] and type(e.Box[1]) ~= "number" then e.Box[1].From = tl e.Box[1].To = tr e.Box[1].Color = col e.Box[1].Visible = true end
            if e.Box[2] and type(e.Box[2]) ~= "number" then e.Box[2].From = tr e.Box[2].To = br e.Box[2].Color = col e.Box[2].Visible = true end
            if e.Box[3] and type(e.Box[3]) ~= "number" then e.Box[3].From = br e.Box[3].To = bl e.Box[3].Color = col e.Box[3].Visible = true end
            if e.Box[4] and type(e.Box[4]) ~= "number" then e.Box[4].From = bl e.Box[4].To = tl e.Box[4].Color = col e.Box[4].Visible = true end

            if Config.ESP.BoxOutline then
                for i = 1, 4 do 
                    if e.BoxOutline[i] and type(e.BoxOutline[i]) ~= "number" and e.Box[i] and type(e.Box[i]) ~= "number" then 
                        e.BoxOutline[i].From = e.Box[i].From
                        e.BoxOutline[i].To = e.Box[i].To
                        e.BoxOutline[i].Thickness = Config.ESP.BoxThickness + 2
                        e.BoxOutline[i].Color = Color3.new(0, 0, 0)
                        e.BoxOutline[i].ZIndex = 1
                        e.BoxOutline[i].Visible = true 
                    end 
                end
            else 
                for i = 1, 4 do 
                    if e.BoxOutline[i] and type(e.BoxOutline[i]) ~= "number" then e.BoxOutline[i].Visible = false end 
                end 
            end
        else
            for i = 1, 4 do 
                if e.Box[i] and type(e.Box[i]) ~= "number" then e.Box[i].Visible = false end
                if e.BoxOutline[i] and type(e.BoxOutline[i]) ~= "number" then e.BoxOutline[i].Visible = false end 
            end
        end

        if Config.ESP.BoxFill and e.Fill[1] and e.Fill[2] then
            pcall(function()
                if type(e.Fill[1]) ~= "number" then 
                    e.Fill[1].PointA = tl
                    e.Fill[1].PointB = tr
                    e.Fill[1].PointC = bl
                    e.Fill[1].Color = fillCol
                    e.Fill[1].Transparency = 1 - Config.ESP.BoxFillTransparency
                    e.Fill[1].Filled = true
                    e.Fill[1].Visible = true 
                end
                if type(e.Fill[2]) ~= "number" then 
                    e.Fill[2].PointA = tr
                    e.Fill[2].PointB = br
                    e.Fill[2].PointC = bl
                    e.Fill[2].Color = fillCol
                    e.Fill[2].Transparency = 1 - Config.ESP.BoxFillTransparency
                    e.Fill[2].Filled = true
                    e.Fill[2].Visible = true 
                end
            end)
        else 
            for i = 1, 2 do 
                if e.Fill[i] and type(e.Fill[i]) ~= "number" then pcall(function() e.Fill[i].Visible = false end) end 
            end 
        end

        local tY = tl.Y - 18

        if Config.ESP.Name and e.Name and type(e.Name) ~= "number" then 
            e.Name.Size = Config.ESP.NameSize
            e.Name.Text = plr.Name
            e.Name.Position = V2(cx, tY)
            e.Name.Color = GetColor(Config.ESP.NameColor, Config.ESP.NameVisibleColor, Config.ESP.NameNotVisibleColor, isVis)
            e.Name.Visible = true
            tY = tY + Config.ESP.NameSize
        elseif e.Name and type(e.Name) ~= "number" then 
            e.Name.Visible = false 
        end

        if Config.ESP.CurrentWeapon.Enabled and e.WeaponName and type(e.WeaponName) ~= "number" then
            local ea = plr:GetAttribute("CurrentEquipped")
            if ea and type(ea) == "string" then 
                local s, ed = pcall(HS.JSONDecode, HS, ea)
                if s and ed and ed.Name then 
                    e.WeaponName.Text = ed.Name
                    e.WeaponName.Color = Config.ESP.CurrentWeapon.Color
                    e.WeaponName.Position = V2(tr.X + 5, (tl.Y + bl.Y) / 2)
                    e.WeaponName.Visible = true 
                else 
                    e.WeaponName.Visible = false 
                end
            else 
                e.WeaponName.Visible = false 
            end
        elseif e.WeaponName and type(e.WeaponName) ~= "number" then 
            e.WeaponName.Visible = false 
        end

        if Config.ESP.HeadDot and e.HeadDot and type(e.HeadDot) ~= "number" then
            local hp = wtvp(Camera, hP)
            if hp.Z > 0 then 
                e.HeadDot.Position = V2(hp.X, hp.Y)
                e.HeadDot.Radius = math.max(sW / 10, 3)
                e.HeadDot.Color = GetColor(Config.ESP.HeadDotColor, Config.ESP.HeadDotVisibleColor, Config.ESP.HeadDotNotVisibleColor, isVis)
                e.HeadDot.Visible = true 
            else 
                e.HeadDot.Visible = false 
            end
        elseif e.HeadDot and type(e.HeadDot) ~= "number" then 
            e.HeadDot.Visible = false 
        end

        if Config.ESP.Distance and e.Dist and type(e.Dist) ~= "number" then 
            e.Dist.Size = 11
            e.Dist.Text = math.floor(dist) .. "m"
            e.Dist.Position = V2(cx, bl.Y + 2)
            e.Dist.Color = Config.ESP.DistanceColor
            e.Dist.Visible = true
        elseif e.Dist and type(e.Dist) ~= "number" then 
            e.Dist.Visible = false 
        end

        if Config.ESP.Health and hum then
            local hp, mhp = hum.Health, hum.MaxHealth
            if mhp <= 0 then mhp = 100 end
            if hp > mhp then mhp = hp end
            local hpF = math.clamp(hp / mhp, 0, 1)
            local bx = tl.X - 5
            local barH = sH * hpF
            if e.HpBg and type(e.HpBg) ~= "number" then 
                e.HpBg.From = V2(bx, bl.Y)
                e.HpBg.To = V2(bx, tl.Y)
                e.HpBg.Visible = true 
            end
            if e.Hp and type(e.Hp) ~= "number" then 
                e.Hp.From = V2(bx, bl.Y)
                e.Hp.To = V2(bx, bl.Y - barH)
                e.Hp.Color = Config.ESP.HealthBarCustom and Config.ESP.HealthBarColor or Color3.fromRGB(255, 0, 0):Lerp(Color3.fromRGB(0, 255, 0), hpF)
                e.Hp.ZIndex = 3
                e.Hp.Visible = true 
            end
        else 
            if e.HpBg and type(e.HpBg) ~= "number" then e.HpBg.Visible = false end
            if e.Hp and type(e.Hp) ~= "number" then e.Hp.Visible = false end 
        end

        if Config.ESP.Skeleton and hum and dist < 300 then
            local skelCol = GetColor(Config.ESP.SkeletonColor, Config.ESP.SkeletonVisibleColor, Config.ESP.SkeletonNotVisibleColor, isVis)
            local isR15 = char:FindFirstChild("UpperTorso") ~= nil
            local bones = isR15 and BONES_R15 or BONES_R6
            table.clear(bonePosCache)
            for i, pair in ipairs(bones) do 
                local ln = e.Skeleton[i]
                if not ln or type(ln) == "number" then continue end
                local p1, p2 = char:FindFirstChild(pair[1]), char:FindFirstChild(pair[2])
                if p1 and p2 then
                    local s1 = bonePosCache[pair[1]]
                    if not s1 then 
                        local p = wtvp(Camera, p1.Position)
                        if p.Z > 0 then s1 = V2(p.X, p.Y) end
                        bonePosCache[pair[1]] = s1 
                    end
                    local s2 = bonePosCache[pair[2]]
                    if not s2 then 
                        local p = wtvp(Camera, p2.Position)
                        if p.Z > 0 then s2 = V2(p.X, p.Y) end
                        bonePosCache[pair[2]] = s2 
                    end
                    if s1 and s2 then 
                        ln.Color = skelCol
                        ln.From = s1
                        ln.To = s2
                        ln.Thickness = Config.ESP.SkeletonThickness
                        ln.Visible = true 
                    else 
                        ln.Visible = false 
                    end
                else 
                    ln.Visible = false 
                end 
            end
            for i = #bones + 1, #e.Skeleton do 
                if e.Skeleton[i] and type(e.Skeleton[i]) ~= "number" then e.Skeleton[i].Visible = false end 
            end
        else 
            for _, ln in pairs(e.Skeleton) do 
                if ln and type(ln) ~= "number" then ln.Visible = false end 
            end 
        end

        if Config.ESP.Highlight and e.HL then 
            pcall(function() 
                e.HL.Adornee = char
                e.HL.FillColor = Config.ESP.VisibilityCheck and (isVis and Config.ESP.HighlightVisibleFill or Config.ESP.HighlightHiddenFill) or Config.ESP.HighlightFill
                e.HL.OutlineColor = Config.ESP.HighlightOutline
                e.HL.Enabled = true 
            end)
        elseif e.HL then 
            pcall(function() e.HL.Enabled = false end) 
        end
    end
end

local function SetupPlayer(p)
    if p ~= LP then
        if ESP_.Players[p] then DestroyPlayerESP(ESP_.Players[p]) end
        ESP_.Players[p] = CreatePlayerESP()
        AC(p.CharacterAdded:Connect(function() 
            if ESP_.Players[p] then HidePlayerESP(ESP_.Players[p]) end 
        end))
        AC(p.CharacterRemoving:Connect(function() 
            if ESP_.Players[p] then HidePlayerESP(ESP_.Players[p]) end 
        end))
    end
end

AC(Players.PlayerAdded:Connect(Safe(SetupPlayer)))
AC(Players.PlayerRemoving:Connect(Safe(function(p)
    if ESP_.Players[p] then 
        DestroyPlayerESP(ESP_.Players[p])
        ESP_.Players[p] = nil 
    end
    if CharmCache[p] then 
        for _, box in pairs(CharmCache[p]) do pcall(function() box:Destroy() end) end
        CharmCache[p] = nil
        CharmVisCache[p] = nil 
    end
end)))

for _, p in pairs(Players:GetPlayers()) do SetupPlayer(p) end

G.CharmFolder = nil
pcall(function() 
    G.CharmFolder = Instance.new("Folder", game:GetService("CoreGui"))
    G.CharmFolder.Name = "Charms_Container" 
end)

G.GraphD = {UI = nil, Lines = {}, Label = nil, PeakLabel = nil, History = {}, LastPos = nil, LastTime = 0, Smoothed = 0, PeakHistory = {}}
G.KSD = {Frame = nil, Elements = {}}
G.AAD = {cachedThreat = nil, lastThreatCheck = 0}

G.LastWorldScan = 0
G.skinApplyDebounce = false
G.lastInvRefresh = 0

G.Exploits = {GrenadePrediction = {Enabled = false, LineColor = Color3.new(1, 1, 1), DotColor = Color3.new(0, 0, 0)}}
Config.Exploits = {GrenadePrediction = {Enabled = false, LineColor = Color3.new(1, 1, 1), DotColor = Color3.new(0, 0, 0)}}

G.GPD = {
    LinePool = {},
    ActiveLines = {},
    Dot = nil,
    LastCalc = 0,
    CachedPts = {},
    CachedHit = false,
    LastCam = CFrame.new(),
    LastVel = Vector3.new(),
    PROPS = {
        ["Default"] = {Restitution = 0.5, Fuse = 3.0, ExplodeOnTouch = false},
        ["Flashbang"] = {Restitution = 0.6, Fuse = 2.0, ExplodeOnTouch = false},
        ["Smoke"] = {Restitution = 0.4, Fuse = 3.0, ExplodeOnTouch = false},
        ["Decoy"] = {Restitution = 0.5, Fuse = 15.0, ExplodeOnTouch = false},
        ["HE"] = {Restitution = 0.4, Fuse = 3.0, ExplodeOnTouch = false},
        ["Molotov"] = {Restitution = 0.2, Fuse = 10.0, ExplodeOnTouch = true},
        ["Incendiary"] = {Restitution = 0.2, Fuse = 10.0, ExplodeOnTouch = true}
    }
}

G.GPD_HoldState = {wasHolding = false, holdType = nil, holdStart = 0, releaseTime = 0, showAfterRelease = false}
G.EB_StartTime = 0

local function UpdateCharms(evf)
    if not Config.Charms.Enabled or not G.CharmFolder then
        for plr, parts in pairs(CharmCache) do 
            for _, box in pairs(parts) do pcall(function() box:Destroy() end) end 
        end
        table.clear(CharmCache)
        table.clear(CharmVisCache)
        return
    end

    local nt = tick()
    local scv = (nt - G.LastCharmVisCheck) > 0.2
    if scv then G.LastCharmVisCheck = nt end

    local ds = (nt - G.LastCharmScan) > 1
    if ds then G.LastCharmScan = nt end

    for _, plr in ipairs(Players:GetPlayers()) do
        if plr ~= LP then
            local ch = plr.Character
            local chm = ch and ch:FindFirstChildWhichIsA("Humanoid")
            if ch and ch:FindFirstChild("HumanoidRootPart") and chm and chm.Health > 0 then
                if Config.Charms.TeamCheck and not is_enemy(plr) then 
                    if CharmCache[plr] then 
                        for _, box in pairs(CharmCache[plr]) do pcall(function() box:Destroy() end) end
                        CharmCache[plr] = nil
                        CharmVisCache[plr] = nil 
                    end
                    continue 
                end

                if not CharmCache[plr] then CharmCache[plr] = {} end

                local chHead = ch:FindFirstChild("Head") or ch.PrimaryPart or ch:FindFirstChild("HumanoidRootPart")
                local iv = CharmVisCache[plr]
                if scv then 
                    iv = false
                    if chHead and evf then iv = evf(ch, chHead.Position) end
                    CharmVisCache[plr] = iv 
                elseif iv == nil then 
                    iv = false 
                end

                local col = iv and Config.Charms.VisibleColor or Config.Charms.HiddenColor

                for pt, box in pairs(CharmCache[plr]) do 
                    local isValid = false
                    pcall(function() 
                        if pt and pt.Parent and pt:IsDescendantOf(ch) and box and box.Parent then isValid = true end 
                    end)
                    if not isValid then 
                        pcall(function() box:Destroy() end)
                        CharmCache[plr][pt] = nil 
                    end 
                end

                for pt, box in pairs(CharmCache[plr]) do 
                    pcall(function() 
                        if pt.Parent and pt:IsDescendantOf(ch) and box:IsA("BoxHandleAdornment") then 
                            box.Size = pt.Size + Vector3.new(0.05, 0.05, 0.05)
                            box.Adornee = pt
                            box.CFrame = CFrame.new()
                            box.SizeRelativeOffset = Vector3.new(0, 0, 0)
                            box.Color3 = col
                            box.Transparency = Config.Charms.Transparency
                            box.AlwaysOnTop = Config.Charms.AlwaysOnTop
                            box.Visible = true 
                        end 
                    end) 
                end

                if ds then
                    local validNames = {"Head","UpperTorso","LowerTorso","LeftUpperArm","LeftLowerArm","LeftHand","RightUpperArm","RightLowerArm","RightHand","LeftUpperLeg","LeftLowerLeg","LeftFoot","RightUpperLeg","RightLowerLeg","RightFoot","Torso","Left Arm","Right Arm","Left Leg","Right Leg"}
                    for _, pt in ipairs(ch:GetDescendants()) do 
                        pcall(function() 
                            if pt:IsA("BasePart") and pt.Name ~= "HumanoidRootPart" and pt.Transparency < 1 and not CharmCache[plr][pt] then 
                                local validPart = false
                                for _, vn in ipairs(validNames) do 
                                    if pt.Name == vn then validPart = true break end 
                                end
                                if validPart then 
                                    local box = Instance.new("BoxHandleAdornment")
                                    box.Name = "Charm_" .. pt.Name
                                    box.Adornee = pt
                                    box.Size = pt.Size + Vector3.new(0.05, 0.05, 0.05)
                                    box.CFrame = CFrame.new()
                                    box.SizeRelativeOffset = Vector3.new(0, 0, 0)
                                    box.Color3 = col
                                    box.Transparency = Config.Charms.Transparency
                                    box.AlwaysOnTop = Config.Charms.AlwaysOnTop
                                    box.ZIndex = 5
                                    box.Parent = G.CharmFolder
                                    CharmCache[plr][pt] = box 
                                end 
                            end 
                        end) 
                    end
                end
            elseif CharmCache[plr] then 
                for _, box in pairs(CharmCache[plr]) do pcall(function() box:Destroy() end) end
                CharmCache[plr] = nil
                CharmVisCache[plr] = nil 
            end
        end
    end

    for plr, parts in pairs(CharmCache) do 
        local valid = false
        pcall(function() 
            if plr and plr.Parent and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then valid = true end 
        end)
        if not valid then 
            for _, box in pairs(parts) do pcall(function() box:Destroy() end) end
            CharmCache[plr] = nil
            CharmVisCache[plr] = nil 
        end 
    end
end

local function InitGraphUI()
    if G.GraphD.UI then return end
    G.GraphD.UI = Instance.new("Frame")
    G.GraphD.UI.Name = "SpeedGraph"
    G.GraphD.UI.Size = UDim2.new(0, 200, 0, 120)
    G.GraphD.UI.Position = UDim2.new(0.5, -100, 0.85, 0)
    G.GraphD.UI.BackgroundTransparency = 1
    G.GraphD.UI.Parent = UI
    MakeDraggable(G.GraphD.UI)

    G.GraphD.Label = Instance.new("TextLabel")
    G.GraphD.Label.Size = UDim2.new(1, 0, 0, 20)
    G.GraphD.Label.Position = UDim2.new(0, 0, 1, -20)
    G.GraphD.Label.BackgroundTransparency = 1
    G.GraphD.Label.Font = Enum.Font.GothamBold
    G.GraphD.Label.TextSize = 18
    G.GraphD.Label.TextStrokeTransparency = 0
    G.GraphD.Label.Text = "0"
    G.GraphD.Label.Parent = G.GraphD.UI
    AddThemeObject(G.GraphD.Label, "Text")

    G.GraphD.PeakLabel = Instance.new("TextLabel")
    G.GraphD.PeakLabel.Size = UDim2.new(1, 0, 0, 18)
    G.GraphD.PeakLabel.Position = UDim2.new(0, 0, 1, -38)
    G.GraphD.PeakLabel.BackgroundTransparency = 1
    G.GraphD.PeakLabel.Font = Enum.Font.GothamBold
    G.GraphD.PeakLabel.TextSize = 16
    G.GraphD.PeakLabel.TextStrokeTransparency = 0
    G.GraphD.PeakLabel.Text = ""
    G.GraphD.PeakLabel.Visible = false
    G.GraphD.PeakLabel.Parent = G.GraphD.UI

    for i = 1, 59 do 
        local ln = Instance.new("Frame")
        ln.BorderSizePixel = 0
        ln.AnchorPoint = Vector2.new(0.5, 0.5)
        ln.BackgroundColor3 = Config.Graph.Color
        ln.Parent = G.GraphD.UI
        G.GraphD.Lines[i] = ln 
    end
end

local function UpdateGraph()
    if not Config.Graph.Enabled then 
        if G.GraphD.UI then G.GraphD.UI.Visible = false end
        return 
    end
    if tick() - G.LastGraphUpdate < 0.05 then return end
    G.LastGraphUpdate = tick()

    InitGraphUI()
    G.GraphD.UI.Visible = true

    local ch = LP.Character
    local hrp = ch and ch:FindFirstChild("HumanoidRootPart")
    local spd = 0
    if hrp then
        local n = tick()
        local gp = hrp.Position
        if G.GraphD.LastPos and G.GraphD.LastTime then
            local dtt = n - G.GraphD.LastTime
            if dtt > 0 then 
                spd = Vector3.new(gp.X - G.GraphD.LastPos.X, 0, gp.Z - G.GraphD.LastPos.Z).Magnitude / dtt 
            end
        end
        G.GraphD.LastPos = gp
        G.GraphD.LastTime = n
    end

    G.GraphD.Smoothed = G.GraphD.Smoothed + ((spd - G.GraphD.Smoothed) * 0.3)
    G.GraphD.History[#G.GraphD.History + 1] = math.min(G.GraphD.Smoothed, Config.Graph.MaxSpeed)
    if #G.GraphD.History > 60 then table.remove(G.GraphD.History, 1) end

    G.GraphD.Label.Text = string.format("%.1f", math.floor(G.GraphD.Smoothed * 100 + 0.5) / 10)
    G.GraphD.Label.TextColor3 = Config.Graph.Color

    if Config.Graph.PeakEnabled and G.GraphD.PeakLabel then
        local now = tick()
        G.GraphD.PeakHistory[#G.GraphD.PeakHistory + 1] = {time = now, speed = G.GraphD.Smoothed}
        while #G.GraphD.PeakHistory > 0 and (now - G.GraphD.PeakHistory[1].time) > 5 do 
            table.remove(G.GraphD.PeakHistory, 1) 
        end
        local peak = 0
        for _, entry in ipairs(G.GraphD.PeakHistory) do 
            if entry.speed > peak then peak = entry.speed end 
        end
        G.GraphD.PeakLabel.Text = string.format("%.1f", math.floor(peak * 100 + 0.5) / 10)
        if peak >= 30 then G.GraphD.PeakLabel.TextColor3 = Color3.fromRGB(255, 50, 50)
        elseif peak >= 20 then G.GraphD.PeakLabel.TextColor3 = Color3.fromRGB(255, 255, 50)
        else G.GraphD.PeakLabel.TextColor3 = Color3.fromRGB(255, 255, 255) end
        G.GraphD.PeakLabel.Visible = true
    elseif G.GraphD.PeakLabel then 
        G.GraphD.PeakLabel.Visible = false 
    end

    local w = G.GraphD.UI.AbsoluteSize.X
    local h = G.GraphD.UI.AbsoluteSize.Y - 40
    local step = w / 60

    for i = 1, 59 do 
        local gl = G.GraphD.Lines[i]
        if gl and i < #G.GraphD.History then
            local p1 = G.GraphD.History[i] or 0
            local p2 = G.GraphD.History[i + 1] or 0
            local h1 = (p1 / Config.Graph.MaxSpeed) * h
            local h2 = (p2 / Config.Graph.MaxSpeed) * h
            local x1 = (i - 1) * step
            local y1 = h - h1
            local x2 = i * step
            local y2 = h - h2
            local gv = Vector2.new(x2 - x1, y2 - y1)
            local ct = Vector2.new((x1 + x2) / 2, (y1 + y2) / 2)
            gl.Position = UDim2.new(0, ct.X, 0, ct.Y)
            gl.Size = UDim2.new(0, gv.Magnitude, 0, 2)
            gl.Rotation = math.deg(math.atan2(gv.Y, gv.X))
            gl.BackgroundColor3 = Config.Graph.Color
            gl.Visible = true
        elseif gl then 
            gl.Visible = false 
        end 
    end
end

local function InitKeystrokesUI()
    if G.KSD.Frame then return end
    G.KSD.Frame = Instance.new("Frame")
    G.KSD.Frame.Name = "Keystrokes"
    G.KSD.Frame.Size = UDim2.new(0, 170, 0, 140)
    G.KSD.Frame.Position = UDim2.new(0.98, -170, 0.02, 63)
    G.KSD.Frame.BackgroundTransparency = 1
    G.KSD.Frame.Parent = UI
    MakeDraggable(G.KSD.Frame)

    local function CK(id, t, sz, kp)
        local f = Instance.new("Frame")
        f.Name = id
        f.Size = sz
        f.Position = kp
        f.BackgroundColor3 = CurrentTheme.Item
        f.BorderSizePixel = 0
        f.Parent = G.KSD.Frame
        Instance.new("UICorner", f).CornerRadius = UDim.new(0, 6)

        local l = Instance.new("TextLabel")
        l.Size = UDim2.new(1, 0, 1, 0)
        l.BackgroundTransparency = 1
        l.Text = t
        l.Font = Enum.Font.GothamBold
        l.TextSize = 20
        l.TextColor3 = CurrentTheme.Text
        l.TextStrokeTransparency = 0
        l.Parent = f

        G.KSD.Elements[id] = {Frame = f, Label = l}
    end

    CK("W", "W", UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0, 0))
    CK("A", "A", UDim2.new(0, 50, 0, 50), UDim2.new(0, 0, 0, 55))
    CK("S", "S", UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0, 55))
    CK("D", "D", UDim2.new(0, 50, 0, 50), UDim2.new(1, -50, 0, 55))
    CK("C", "C", UDim2.new(0, 50, 0, 30), UDim2.new(0, 0, 0, 110))
    CK("Space", "", UDim2.new(0, 115, 0, 30), UDim2.new(0, 55, 0, 110))
end

local function UpdateMovementDisplay()
    if not Config.MovementDisplay.Enabled then 
        if G.KSD.Frame then G.KSD.Frame.Visible = false end
        return 
    end
    if tick() - G.LastMovementUpdate < 0.05 then return end
    G.LastMovementUpdate = tick()

    InitKeystrokesUI()
    G.KSD.Frame.Visible = true

    local km = {
        {Id = "W", Input = Enum.KeyCode.W},
        {Id = "A", Input = Enum.KeyCode.A},
        {Id = "S", Input = Enum.KeyCode.S},
        {Id = "D", Input = Enum.KeyCode.D},
        {Id = "C", Input = {Enum.KeyCode.LeftControl, Enum.KeyCode.RightControl, Enum.KeyCode.C}},
        {Id = "Space", Input = Enum.KeyCode.Space}
    }

    for _, kd in ipairs(km) do 
        local el = G.KSD.Elements[kd.Id]
        if el then
            local pr = false
            if type(kd.Input) == "table" then
                for _, kc in ipairs(kd.Input) do 
                    if UIS:IsKeyDown(kc) then pr = true break end 
                end
            else 
                pr = UIS:IsKeyDown(kd.Input) 
            end
            el.Frame.BackgroundColor3 = pr and CurrentTheme.Accent or CurrentTheme.Item
            el.Label.TextColor3 = CurrentTheme.Text
        end 
    end
end

pcall(function() 
    local d = Drawing.new("Circle")
    if d and type(d) ~= "number" then 
        d.Radius = 5
        d.Filled = true
        d.Visible = false
        AD(d)
        G.GPD.Dot = d 
    end 
end)

local function GetGPL() 
    local l = table.remove(G.GPD.LinePool)
    if not l then 
        l = NewDrawing("Line", {Thickness = 2, Transparency = 1, Visible = false}) 
    end
    if l and type(l) ~= "number" then 
        G.GPD.ActiveLines[#G.GPD.ActiveLines + 1] = l 
    end
    return l 
end

local function ClearGPL()
    for _, l in ipairs(G.GPD.ActiveLines) do 
        if l and type(l) ~= "number" then l.Visible = false end
        G.GPD.LinePool[#G.GPD.LinePool + 1] = l 
    end
    table.clear(G.GPD.ActiveLines)
    if G.GPD.Dot and type(G.GPD.Dot) ~= "number" then G.GPD.Dot.Visible = false end
end

local function UpdateGP()
    if not Config.Exploits.GrenadePrediction.Enabled then 
        ClearGPL()
        G.GPD_HoldState.wasHolding = false
        G.GPD_HoldState.showAfterRelease = false
        return 
    end

    local cam = workspace.CurrentCamera
    if not cam then return end

    local function ggp()
        for _, c in pairs(cam:GetChildren()) do
            if c:IsA("Model") and not c.Name:find("Arm") then
                local n = c.Name:lower()
                if n:find("molotov") or n:find("incendiary") then return G.GPD.PROPS["Molotov"] end
                if n:find("flash") then return G.GPD.PROPS["Flashbang"] end
                if n:find("smoke") then return G.GPD.PROPS["Smoke"] end
                if n:find("he") or n:find("grenade") then return G.GPD.PROPS["HE"] end
                if n:find("decoy") then return G.GPD.PROPS["Decoy"] end
            end
        end
        return nil
    end

    local gpp = ggp()
    if not gpp then 
        ClearGPL()
        G.GPD_HoldState.wasHolding = false
        G.GPD_HoldState.showAfterRelease = false
        return 
    end

    local isLeftClick = UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
    local isRightClick = UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)
    local isHolding = isLeftClick or isRightClick
    local now = tick()

    if isHolding and not G.GPD_HoldState.wasHolding then
        G.GPD_HoldState.holdStart = now
        G.GPD_HoldState.holdType = isRightClick and "right" or "left"
        G.GPD_HoldState.showAfterRelease = false 
    end
    if not isHolding and G.GPD_HoldState.wasHolding then
        G.GPD_HoldState.releaseTime = now
        G.GPD_HoldState.showAfterRelease = true 
    end
    G.GPD_HoldState.wasHolding = isHolding

    local shouldShow = isHolding
    if G.GPD_HoldState.showAfterRelease and (now - G.GPD_HoldState.releaseTime) < 0.7 then shouldShow = true end
    if G.GPD_HoldState.showAfterRelease and (now - G.GPD_HoldState.releaseTime) >= 0.7 then G.GPD_HoldState.showAfterRelease = false end

    if shouldShow then
        local ch = LP.Character
        if not ch or not ch.PrimaryPart then ClearGPL() return end

        local gPos = cam.CFrame.Position
        local gDir = cam.CFrame.LookVector
        local cc = cam.CFrame
        local pV = ch.PrimaryPart.AssemblyLinearVelocity

        local throwType = G.GPD_HoldState.holdType or "left"
        if isHolding then 
            throwType = isRightClick and "right" or "left"
            G.GPD_HoldState.holdType = throwType 
        end

        local cv = (now - G.GPD.LastCalc < 0.033) and (cc.Position - G.GPD.LastCam.Position).Magnitude < 0.05 and (cc.LookVector - G.GPD.LastCam.LookVector).Magnitude < 0.005 and (pV - G.GPD.LastVel).Magnitude < 0.05

        if not cv then
            local throwSpeed = throwType == "right" and 60 or 125
            local vel = (gDir * throwSpeed) + pV
            local pts = {gPos}
            local dts = 0.03
            local grav = Vector3.new(0, -workspace.Gravity, 0)
            local te = 0
            local grp = RaycastParams.new()
            grp.FilterType = Enum.RaycastFilterType.Exclude
            grp.IgnoreWater = true
            local gf = {ch, cam}
            local db = workspace:FindFirstChild("Debris")
            if db then gf[#gf + 1] = db end
            pcall(function() grp.FilterDescendantsInstances = gf end)

            for i = 1, math.floor(4.0 / dts) do
                te = te + dts
                vel = vel + (grav * dts)
                vel = vel * (1 - 0.02)
                local np = gPos + (vel * dts)
                local ray = workspace:Raycast(gPos, np - gPos, grp)
                if ray then
                    if gpp.ExplodeOnTouch and ray.Normal.Y > 0.5 then 
                        gPos = ray.Position
                        break 
                    end
                    local n = ray.Normal
                    vel = (vel - (2 * vel:Dot(n) * n)) * gpp.Restitution
                    gPos = ray.Position + (n * 0.05)
                    if vel.Magnitude < 5 then break end
                else 
                    gPos = np 
                end
                pts[#pts + 1] = gPos
                if te >= gpp.Fuse then break end
            end

            G.GPD.CachedPts = pts
            G.GPD.LastCalc = now
            G.GPD.LastCam = cc
            G.GPD.LastVel = pV
        end

        ClearGPL()
        local pts = G.GPD.CachedPts
        for i = 1, #pts - 1 do
            local s1, v1 = cam:WorldToViewportPoint(pts[i])
            local s2, v2 = cam:WorldToViewportPoint(pts[i + 1])
            if v1 and v2 then
                local l = GetGPL()
                if l and type(l) ~= "number" then
                    l.From = Vector2.new(s1.X, s1.Y)
                    l.To = Vector2.new(s2.X, s2.Y)
                    l.Color = Config.Exploits.GrenadePrediction.LineColor
                    l.Visible = true
                end
            end
        end

        if #pts > 0 and G.GPD.Dot and type(G.GPD.Dot) ~= "number" then
            local sp, so = cam:WorldToViewportPoint(pts[#pts])
            if so then
                G.GPD.Dot.Position = Vector2.new(sp.X, sp.Y)
                G.GPD.Dot.Color = Config.Exploits.GrenadePrediction.DotColor
                G.GPD.Dot.Visible = true
            else 
                G.GPD.Dot.Visible = false 
            end
        end
    else 
        ClearGPL() 
    end
end

AC(RS.Heartbeat:Connect(function(dt)
    local jbOn = IsJBEBActive(Config.JumpBug)
    local ebOn = IsJBEBActive(Config.EdgeBug)
    if not jbOn and not ebOn then return end

    local char = LP.Character
    if not char then return end
    local root = char:FindFirstChild("HumanoidRootPart")
    local hum = char:FindFirstChildWhichIsA("Humanoid")
    if not root or not hum then return end

    JBEB_SetFilter(char)

    local vel = root.AssemblyLinearVelocity
    local pos = root.Position
    local vy = vel.Y
    local floor = hum.FloorMaterial
    local inAir = floor == Enum.Material.Air
    local onGround = JBEB_GameGroundCheck(pos)

    if JBCooldown > 0 then JBCooldown = JBCooldown - dt end

    if EB_Active then
        if not ebOn then 
            EB_Active = false
            ebFlashTime = tick()
        elseif (onGround and vy <= 1) or not JBEB_StillOnEdge(pos) or (tick() - G.EB_StartTime > Config.EdgeBug.MaxDuration) then
            EB_Active = false
            ebFlashTime = tick()
        else
            root.AssemblyLinearVelocity = Vector3.new(vel.X * 0.995, 0, vel.Z * 0.995)
            return
        end
    end

    local gameThinkGround = (onGround and vy <= 1) or not inAir

    if not gameThinkGround then
        JBEB_WasAir = true
        JBEB_LandedFrame = false
        if vy < -1 then
            JBEB_FallFrames = JBEB_FallFrames + 1
            JBEB_VelBuffer[#JBEB_VelBuffer + 1] = vy
            if #JBEB_VelBuffer > JBEB_BufferSize then table.remove(JBEB_VelBuffer, 1) end
        end
    end

    if gameThinkGround and JBEB_WasAir then
        JBEB_LandedFrame = true
        JBEB_WasAir = false
    elseif gameThinkGround and not JBEB_WasAir then
        JBEB_LandedFrame = false
    end

    if jbOn and JBEB_LandedFrame and JBCooldown <= 0 and JBEB_FallFrames >= JB_MIN_FRAMES then
        local hSpeed = math.sqrt(vel.X ^ 2 + vel.Z ^ 2)
        local power = Config.JumpBug.Power or 1.0
        local newH = math.min(hSpeed + (JB_HORIZ_BOOST * power), 24.5)
        local newVY = vy + (JB_VERT_BOOST * power)
        if hSpeed > 0.5 then
            local dir = Vector3.new(vel.X, 0, vel.Z).Unit
            root.AssemblyLinearVelocity = Vector3.new(dir.X * newH, newVY, dir.Z * newH)
        else
            root.AssemblyLinearVelocity = Vector3.new(vel.X, newVY, vel.Z)
        end
        JBCooldown = 0.4
        JBActive = true
        jbFlashTime = tick()
        JBEB_FallFrames = 0
        table.clear(JBEB_VelBuffer)
        task.delay(0.2, function() JBActive = false end)
    end

    if gameThinkGround and not JBEB_LandedFrame then
        JBEB_FallFrames = 0
        table.clear(JBEB_VelBuffer)
    end

    if ebOn and not gameThinkGround and vy < -8 and not EB_Active and not JBActive then
        if JBEB_IsNearEdge(pos) then
            EB_Active = true
            G.EB_StartTime = tick()
            ebFlashTime = tick()
            JBEB_FallFrames = 0
            table.clear(JBEB_VelBuffer)
            root.AssemblyLinearVelocity = Vector3.new(vel.X, 0, vel.Z)
        end
    end
end))

task.spawn(function()
    task.wait(0.5)
    local gui = Instance.new("ScreenGui")
    gui.Name = "JBEB_Indicator"
    gui.ResetOnSpawn = false
    pcall(function() gui.Parent = GetUIParent() end)
    JBEB_IndicatorGui = gui

    local function CreateIndicatorLabel(text, xPos)
        local container = Instance.new("Frame", gui)
        container.Size = UDim2.new(0, 40, 0, 30)
        container.Position = UDim2.new(0.5, xPos, 1, -50)
        container.BackgroundTransparency = 1
        container.Visible = false

        local main = Instance.new("TextLabel", container)
        main.Name = "Main"
        main.Size = UDim2.new(1, 0, 1, 0)
        main.BackgroundTransparency = 1
        main.Font = Enum.Font.GothamBold
        main.TextSize = 18
        main.Text = text
        main.TextColor3 = Color3.fromRGB(255, 255, 255)
        main.TextStrokeTransparency = 0
        main.TextStrokeColor3 = Color3.new(0, 0, 0)
        main.TextXAlignment = Enum.TextXAlignment.Center

        return container
    end

    JBEB_JBLabel = CreateIndicatorLabel("jb", -35)
    JBEB_EBLabel = CreateIndicatorLabel("eb", 5)

    AC(RS.RenderStepped:Connect(function()
        if Config.JBEBIndicator then
            if JBEB_JBLabel then 
                JBEB_JBLabel.Visible = JBActive
                if JBActive then 
                    local m = JBEB_JBLabel:FindFirstChild("Main")
                    if m then m.TextColor3 = Config.JBColor end 
                end 
            end
            if JBEB_EBLabel then 
                JBEB_EBLabel.Visible = EB_Active
                if EB_Active then 
                    local m = JBEB_EBLabel:FindFirstChild("Main")
                    if m then m.TextColor3 = Config.EBColor end 
                end 
            end
        else
            if JBEB_JBLabel then JBEB_JBLabel.Visible = false end
            if JBEB_EBLabel then JBEB_EBLabel.Visible = false end
        end
    end))
end)

local function UpdateInventoryNames()
    local invGui = LP:FindFirstChild("PlayerGui") and LP.PlayerGui:FindFirstChild("MainGui")
    if not invGui then return end
    local gameplay = invGui:FindFirstChild("Gameplay")
    if not gameplay then return end
    local bottom = gameplay:FindFirstChild("Bottom")
    if not bottom then return end
    local inv = bottom:FindFirstChild("Inventory")
    if not inv then return end

    local meleeSlot = inv:FindFirstChild("Melee")
    if meleeSlot and Config.KnifeChanger.Enabled then
        local weapon = meleeSlot:FindFirstChild("Weapon")
        if weapon then
            local weaponName = weapon:FindFirstChild("WeaponName")
            if weaponName and weaponName:IsA("TextLabel") then
                local knifeModel = Config.KnifeChanger.Model
                local sel = Config.SkinChanger.Skins[knifeModel]
                local star = utf8.char(9733)
                if sel and sel ~= "Default" then
                    weaponName.Text = star .. " " .. knifeModel .. " | " .. sel
                else
                    weaponName.Text = star .. " " .. knifeModel
                end
            end
            local meleeImg = weapon:FindFirstChild("Melee")
            if meleeImg and meleeImg:IsA("ImageLabel") then
                pcall(function()
                    local knifeModel = Config.KnifeChanger.Model
                    local weaponDB = RepStore:FindFirstChild("Database") and RepStore.Database:FindFirstChild("Custom") and RepStore.Database.Custom:FindFirstChild("Weapons")
                    if weaponDB then
                        local weaponModule = weaponDB:FindFirstChild(knifeModel)
                        if weaponModule then
                            local weaponData = SafeRequire(weaponModule)
                            if weaponData and type(weaponData) == "table" and weaponData.Icon then
                                meleeImg.Image = weaponData.Icon
                            end
                        end
                    end
                end)
            end
        end
    end

    for _, child in ipairs(inv:GetDescendants()) do
        if child:IsA("TextLabel") and child.Name == "WeaponName" then
            if meleeSlot and child:IsDescendantOf(meleeSlot) then continue end
            if not child.Text:find("|") then continue end
            local baseName = child.Text:split(" | ")[1]:gsub("%s+$", "")
            local sel = Config.SkinChanger.Skins[baseName]
            if sel and sel ~= "Default" then
                child.Text = baseName .. " | " .. sel
            else
                child.Text = baseName
            end
        end
    end
end

local function GetWeaponModel()
    local cam = workspace.CurrentCamera
    if not cam then return nil end
    for _, ch in pairs(cam:GetChildren()) do
        if ch:IsA("Model") and ch.Name ~= "Arms" and ch.Name ~= "Arms1" and ch.Name ~= "Arms2" and ch.Name ~= "Viewmodel" then
            return ch
        end
    end
    return nil
end

local function ApplySkin()
    if not SD.SkinsRoot then return end
    local wm = GetWeaponModel()
    if not wm then return end
    local own = wm.Name
    local ewn = own
    local ca = false
    if Checkknife(own) then
        if Config.KnifeChanger.Enabled then ewn = Config.KnifeChanger.Model ca = true end
    else
        if Config.SkinChanger.Enabled then ca = true end
    end
    if not ca then return end

    local cur = wm:GetAttribute("BankrollSkin")
    local sel = Config.SkinChanger.Skins[ewn]
    if not sel or sel == "Default" then return end
    if cur == sel then return end

    local wsf = SD.SkinsRoot:FindFirstChild(ewn)
    if not wsf then return end
    local sf = wsf:FindFirstChild(sel)
    if not sf then return end
    local cf = sf:FindFirstChild("Camera")
    if not cf then return end
    local fn = cf:FindFirstChild("Factory New")
    if not fn then return end

    for _, sa in pairs(fn:GetChildren()) do
        if sa:IsA("SurfaceAppearance") then
            local pt = wm:FindFirstChild(sa.Name, true)
            if pt and (pt:IsA("BasePart") or pt:IsA("MeshPart")) then
                for _, old in pairs(pt:GetChildren()) do
                    if old:IsA("SurfaceAppearance") then old:Destroy() end
                end
                sa:Clone().Parent = pt
            end
        end
    end

    wm:SetAttribute("BankrollSkin", sel)
    UpdateInventoryNames()
end

local function ApplyGloves()
    if not Config.GloveChanger.Enabled then return end
    local cam = workspace.CurrentCamera
    if not cam then return end

    local am
    for _, ch in ipairs(cam:GetChildren()) do
        if ch:IsA("Model") and (ch.Name:match("Arms") or ch:FindFirstChild("Right Arm")) then
            am = ch
            break
        end
    end
    if not am then return end

    local la = am:FindFirstChild("Left Arm")
    local ra = am:FindFirstChild("Right Arm")
    if not la or not ra then return end

    local lg = la:FindFirstChild("Glove")
    local rg = ra:FindFirstChild("Glove")
    if not lg or not rg then return end

    for _, old in pairs(lg:GetChildren()) do if old:IsA("SurfaceAppearance") then old:Destroy() end end
    for _, old in pairs(rg:GetChildren()) do if old:IsA("SurfaceAppearance") then old:Destroy() end end

    local selectedModel = Config.GloveChanger.Model
    if not selectedModel then return end
    local sel = Config.GloveChanger.Gloves[selectedModel]
    if not sel or sel == "Default" then return end

    if not SD.SkinsRoot then return end
    local gloveSkinFolder = SD.SkinsRoot:FindFirstChild(selectedModel)
    if not gloveSkinFolder then return end
    local skinVariant = gloveSkinFolder:FindFirstChild(sel)
    if not skinVariant then return end
    local cameraFolder = skinVariant:FindFirstChild("Camera")
    if not cameraFolder then return end
    local factoryNew = cameraFolder:FindFirstChild("Factory New")
    if not factoryNew then return end

    for _, sa in pairs(factoryNew:GetChildren()) do
        if sa:IsA("SurfaceAppearance") then
            sa:Clone().Parent = lg
            sa:Clone().Parent = rg
        end
    end
end

local function TrySkinApply()
    if G.skinApplyDebounce then return end
    G.skinApplyDebounce = true
    task.spawn(function()
        task.wait(0.2)
        pcall(function()
            if Config.SkinChanger.Enabled or Config.KnifeChanger.Enabled then ApplySkin() end
            if Config.GloveChanger.Enabled then ApplyGloves() end
        end)
        task.wait(0.3)
        pcall(UpdateInventoryNames)
        G.skinApplyDebounce = false
    end)
end

task.spawn(Safe(function()
    while true do
        local cam = workspace.CurrentCamera
        if cam then
            AC(cam.ChildAdded:Connect(Safe(function()
                if Config.SkinChanger.Enabled or Config.KnifeChanger.Enabled or Config.GloveChanger.Enabled then
                    TrySkinApply()
                end
            end)))
            break
        end
        task.wait(1)
    end
end))

pcall(function()
    AC(workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(Safe(function()
        local nc = workspace.CurrentCamera
        if nc then
            AC(nc.ChildAdded:Connect(Safe(function()
                if Config.SkinChanger.Enabled or Config.KnifeChanger.Enabled or Config.GloveChanger.Enabled then
                    TrySkinApply()
                end
            end)))
        end
    end)))
end)

local function IsVisFromChar(o, tp, ac)
    local d = (tp.Position - o)
    pcall(function() RP_.aa.FilterDescendantsInstances = {ac} end)
    local r = workspace:Raycast(o, d, RP_.aa)
    if r then
        local hi
        pcall(function() hi = r.Instance end)
        if hi and tp.Parent then
            local id = false
            pcall(function() id = hi:IsDescendantOf(tp.Parent) end)
            return id
        end
        return false
    end
    return true
end

local function getThreat(ac, ar)
    local cl, cd = nil, 200
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= LP and is_enemy(p) and p.Character then
            local er = p.Character:FindFirstChild("HumanoidRootPart")
            local eh = p.Character:FindFirstChild("Head")
            if er and (er.Position - ar.Position).Magnitude < cd then
                if eh and IsVisFromChar(ar.Position, eh, ac) then
                    cl = p.Character
                    cd = (er.Position - ar.Position).Magnitude
                end
            end
        end
    end
    return cl
end

local ttF = {}

AC(RS.RenderStepped:Connect(Safe(function()
    G.FrameCount = G.FrameCount + 1
    local ch = LP.Character
    G.LocalCharacter = ch

    local lHum = ch and ch:FindFirstChildWhichIsA("Humanoid")
    local lRoot = ch and ch:FindFirstChild("HumanoidRootPart")

    Camera = workspace.CurrentCamera
    if not Camera then return end

    if Config.AutoBhop and lHum and lRoot then
        if IsHoldKeyDown(Config.BhopKey) then
            if lHum.FloorMaterial ~= Enum.Material.Air then
                lHum.Jump = true
            end
        end
    end

    if Config.ESP.Enabled then pcall(UpdateESP) end
    pcall(UpdateWorldESP)

    if Config.Charms.Enabled and (tick() - G.LastCharmUpdate > 0.1) then
        G.LastCharmUpdate = tick()
        pcall(UpdateCharms, ESP_IsVisible)
    end

    if Config.Graph.Enabled then pcall(UpdateGraph) end
    pcall(UpdateMovementDisplay)

    local SC = V2(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
    if Circle and type(Circle) ~= "number" then
        if Config.Aimbot.DrawFOV and Config.Aimbot.Enabled then
            Circle.Visible = true
            Circle.Radius = Config.Aimbot.FOV
            Circle.Position = SC
        else
            Circle.Visible = false
        end
    end

    local akd = false
    if Config.Aimbot.Mode == "Hold" then
        akd = IsHoldKeyDown(Config.Aimbot.HoldKey)
    else
        akd = G.AimbotActive
    end

    if Config.Aimbot.Enabled and akd then
        local bt, bd = nil, Config.Aimbot.FOV
        for _, plr in pairs(Players:GetPlayers()) do
            if plr == LP or not plr.Character or not ch then continue end
            if Config.Aimbot.TeamCheck and not is_enemy(plr) then continue end
            local ah = plr.Character:FindFirstChildWhichIsA("Humanoid")
            if Config.Aimbot.AliveCheck and ah and ah.Health <= 0 then continue end
            local pt = plr.Character:FindFirstChild(Config.Aimbot.TargetPart)
            if not pt then continue end
            local sp, ao = Camera:WorldToViewportPoint(pt.Position)
            if not ao then continue end
            if Config.Aimbot.WallCheck and not IsVisible(pt) then continue end
            local ad = (V2(sp.X, sp.Y) - SC).Magnitude
            if ad < bd then
                bt = V2(sp.X, sp.Y)
                bd = ad
            end
        end
        if bt then
            local sm = math.max(1, Config.Aimbot.Smoothness)
            G.mousemoverel((bt.X - SC.X) / sm, (bt.Y - SC.Y) / sm)
        end
    end

    local tkd = false
    if Config.Triggerbot.Mode == "Hold" then
        tkd = IsHoldKeyDown(Config.Triggerbot.HoldKey)
    else
        tkd = G.TriggerbotActive
    end

    if Config.Triggerbot.Enabled and tkd and (tick() - G.lastTriggerTime) > Config.Triggerbot.Delay then
        local ro = Camera.CFrame.Position
        local rd = Camera.CFrame.LookVector * 1000
        RP_.trigger.FilterType = Enum.RaycastFilterType.Exclude
        table.clear(ttF)
        if ch then ttF[1] = ch end
        if workspace.CurrentCamera then ttF[#ttF + 1] = workspace.CurrentCamera end
        pcall(function() RP_.trigger.FilterDescendantsInstances = ttF end)

        local rr = workspace:Raycast(ro, rd, RP_.trigger)
        local ss = false

        if rr then
            local hp
            pcall(function() hp = rr.Instance end)
            if hp then
                local hc
                pcall(function() hc = hp:FindFirstAncestorOfClass("Model") end)
                local hh = hc and hc:FindFirstChildWhichIsA("Humanoid")
                if hc and hh and hc:FindFirstChild("HumanoidRootPart") then
                    local hpp = Players:GetPlayerFromCharacter(hc)
                    if hpp and (not Config.Triggerbot.TeamCheck or is_enemy(hpp)) then
                        ss = true
                    end
                end
            end
        end

        if ss then
            G.lastTriggerTime = tick()
            G.mouse1click()
        end
    end

    if Config.ShowKeybinds then
        if G.FrameCount % 6 == 0 then
            KeybindList.Visible = true
            if Config.Aimbot.Enabled then
                AimbotKeyLabel.Text = "Aimbot [" .. Config.Aimbot.HoldKey.Name .. "] (" .. Config.Aimbot.Mode .. ")"
                AimbotKeyLabel.TextColor3 = akd and CurrentTheme.Accent or CurrentTheme.Text
                AimbotKeyLabel.Visible = true
            else
                AimbotKeyLabel.Visible = false
            end
            if Config.Triggerbot.Enabled then
                TriggerKeyLabel.Text = "Trigger [" .. Config.Triggerbot.HoldKey.Name .. "] (" .. Config.Triggerbot.Mode .. ")"
                TriggerKeyLabel.TextColor3 = tkd and CurrentTheme.Accent or CurrentTheme.Text
                TriggerKeyLabel.Visible = true
            else
                TriggerKeyLabel.Visible = false
            end
            if Config.AutoBhop then
                BhopKeyLabel.Text = "Bhop [" .. Config.BhopKey.Name .. "] (Hold)"
                BhopKeyLabel.TextColor3 = IsHoldKeyDown(Config.BhopKey) and CurrentTheme.Accent or CurrentTheme.Text
                BhopKeyLabel.Visible = true
            else
                BhopKeyLabel.Visible = false
            end
            if Config.JumpBug.Enabled and Config.JumpBug.Mode ~= "Always" then
                local jbKeyName = Config.JumpBug.Key and Config.JumpBug.Key.Name or "None"
                JBKeyLabel.Text = "JumpBug [" .. jbKeyName .. "] (" .. Config.JumpBug.Mode .. ")"
                JBKeyLabel.TextColor3 = IsJBEBActive(Config.JumpBug) and CurrentTheme.Accent or CurrentTheme.Text
                JBKeyLabel.Visible = true
            else
                JBKeyLabel.Visible = false
            end
            if Config.EdgeBug.Enabled and Config.EdgeBug.Mode ~= "Always" then
                local ebKeyName = Config.EdgeBug.Key and Config.EdgeBug.Key.Name or "None"
                EBKeyLabel.Text = "EdgeBug [" .. ebKeyName .. "] (" .. Config.EdgeBug.Mode .. ")"
                EBKeyLabel.TextColor3 = IsJBEBActive(Config.EdgeBug) and CurrentTheme.Accent or CurrentTheme.Text
                EBKeyLabel.Visible = true
            else
                EBKeyLabel.Visible = false
            end
        end
    else
        KeybindList.Visible = false
    end

    if Config.SpectatorList then
        SpectatorList.Visible = true
        local sc = 0
        pcall(function() sc = LP:GetAttribute("Spectators") or 0 end)
        SpecLabel.Text = "Spectators: " .. tostring(sc)
    else
        SpectatorList.Visible = false
    end

    if Config.SmokeRemover then
        pcall(function()
            for _, v in pairs(workspace:GetDescendants()) do
                if v.Name:match("VoxelSmoke") then
                    v:ClearAllChildren()
                    v:Destroy()
                end
            end
        end)
    end
end)))

AC(RS.Heartbeat:Connect(Safe(function()
    if tick() - G.LastWorldScan < 0.2 then return end
    G.LastWorldScan = tick()

    local debris = workspace:FindFirstChild("Debris")
    if not debris then return end

    local cdw, cmol, csmk = {}, {}, {}
    local bf = false

    for _, item in ipairs(debris:GetChildren()) do
        if Config.ESP.DroppedWeapons.Enabled and item:IsA("Model") and item:GetAttribute("Weapon") and item:GetAttribute("CanPickup") == true then
            cdw[item] = true
            if not WorldESP.DroppedWeapons[item] then
                WorldESP.DroppedWeapons[item] = CreateWorldESPObject(true, false)
                WorldESP.DroppedWeapons[item].Model = item
            end
        end
        if Config.ESP.Bomb.Enabled and item:IsA("Model") and item.Name == "Character" and item:GetAttribute("BombPlanted") then
            bf = true
            if WorldESP.Bomb and WorldESP.Bomb.Model ~= item then
                DestroyWESP(WorldESP.Bomb)
                WorldESP.Bomb = nil
            end
            if not WorldESP.Bomb then
                WorldESP.Bomb = CreateWorldESPObject(true, false)
                WorldESP.Bomb.Model = item
            end
        end
        if Config.ESP.Molotovs.Enabled and item:IsA("Folder") and item.Name:match("^VoxelFire") then
            cmol[item] = true
            if not WorldESP.Molotovs[item] then
                WorldESP.Molotovs[item] = CreateWorldESPObject(true, true)
                WorldESP.Molotovs[item].Model = item
            end
        end
        if Config.ESP.Smokes.Enabled and item:IsA("Folder") and item.Name:match("^VoxelSmoke") then
            csmk[item] = true
            if not WorldESP.Smokes[item] then
                WorldESP.Smokes[item] = CreateWorldESPObject(true, true)
                WorldESP.Smokes[item].Model = item
            end
        end
    end

    for item, eo in pairs(WorldESP.DroppedWeapons) do 
        if not cdw[item] then 
            DestroyWESP(eo)
            WorldESP.DroppedWeapons[item] = nil 
        end 
    end
    for item, eo in pairs(WorldESP.Molotovs) do 
        if not cmol[item] then 
            DestroyWESP(eo)
            WorldESP.Molotovs[item] = nil 
        end 
    end
    for item, eo in pairs(WorldESP.Smokes) do 
        if not csmk[item] then 
            DestroyWESP(eo)
            WorldESP.Smokes[item] = nil 
        end 
    end
    if not bf and WorldESP.Bomb then 
        DestroyWESP(WorldESP.Bomb)
        WorldESP.Bomb = nil 
    end
end)))

AC(RS.Heartbeat:Connect(Safe(function()
    if not Config.AntiAim.Enabled then return end
    local nt = tick()

    pcall(function()
        local ac = LP.Character
        if ac then
            local ar = ac:FindFirstChild("HumanoidRootPart")
            local ah = ac:FindFirstChildWhichIsA("Humanoid")
            if ar and ah then
                if (nt - G.AAD.lastThreatCheck) > 0.15 then
                    G.AAD.lastThreatCheck = nt
                    G.AAD.cachedThreat = getThreat(ac, ar)
                end
                if G.AAD.cachedThreat and G.AAD.cachedThreat:FindFirstChild("HumanoidRootPart") then
                    ah.AutoRotate = false
                    local tp = G.AAD.cachedThreat.HumanoidRootPart.Position
                    local la = CFrame.lookAt(ar.Position, Vector3.new(tp.X, ar.Position.Y, tp.Z))
                    local j = math.random(-Config.AntiAim.JitterRange, Config.AntiAim.JitterRange)
                    ar.CFrame = la * CFrame.Angles(0, math.rad(Config.AntiAim.YawOffset + j), 0)
                else
                    ah.AutoRotate = true
                end
            end
        end
    end)
end)))

pcall(function() 
    if LP:FindFirstChild("PlayerGui") then
        AC(LP.PlayerGui.ChildAdded:Connect(Safe(function(child) 
            if Config.FlashRemover and child.Name == "FlashbangEffect" then 
                pcall(function() child:Destroy() end) 
            end 
        end))) 
    end 
end)

pcall(function() 
    AC(game:GetService("Lighting").ChildAdded:Connect(Safe(function(child) 
        if Config.FlashRemover and child.Name == "FlashbangColorCorrection" then 
            pcall(function() child:Destroy() end) 
        end 
    end))) 
end)

AC(RS.Heartbeat:Connect(Safe(function()
    if (Config.SkinChanger.Enabled or Config.KnifeChanger.Enabled) and tick() - G.lastInvRefresh > 2 then
        G.lastInvRefresh = tick()
        pcall(UpdateInventoryNames)
    end
end)))

print("[bankroll] Loaded successfully")
]=])()

Features & Information

its bankroll bloxstrike script but open src
#bankroll#bloxstrike#open source#src

Community Comments (1)

dvmberdvmberMay 6, 2026

Works on Pot, a bit sad knife changer doesn't work on it. But who am I to complain. 10/10 script.

More Scripts for [NEW MAP] BloxStrike