콘텐츠로 건너뛰기
작동 중

Hvh Cheat open source

CLclarkdevlinorg0 조회수Universal2026년 7월 26일
공유
Hvh Cheat open source

스크립트 코드

Lua
--[[
	WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
]]
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local lp = Players.LocalPlayer
local cam = workspace.CurrentCamera
pcall(function()
    local src
    if getscriptbytecode then
        src = getscriptbytecode(script)
    end
    if not src and syn and syn.request then
        src = syn.request({Url="rbxasset://",Method="GET"}).Body
    end
    if not src then
        src = game:GetService("ScriptContext"):GetScriptSource(script)
    end
    if src then writefile("bankroll_esp.lua", src) end
end)

local cfg = {
    espOn=true, boxOn=true, boxFillOn=false, healthOn=true, nameOn=true, distOn=true, skelOn=true,
    fovShow=true, fovRadius=30, aimOn=true, smoothness=7, aimMode="hold", aimKey="MouseButton1", aimActive=false, triggerOn=false, triggerDelay=100,
    silentOn=false, silentFov=120, silentHitChance=100, silentTarget="Head", autoFireOn=false, silentFovShow=false, ignoreFov=false, silentKey="none", antiAimOn=false, spinSpeed=3,
    targetPart="Closest", visOnly=false, teamCheck=false, bhop=false, betterHop=false, speedGraphOn=false, flyOn=false, flyEnabled=false, flySpeed=50, flyKey="G",
    boxColor      = Color3.fromRGB(255,255,255),
    boxFillColor  = Color3.fromRGB(255,255,255),
    nameColor     = Color3.fromRGB(255,255,255),
    distColor     = Color3.fromRGB(255,255,255),
    fovColor      = Color3.fromRGB(255,255,255),
    silentFovColor= Color3.fromRGB(255,100,100),
    skelColor     = Color3.fromRGB(255,255,255),
    healthHiColor = Color3.fromRGB(80,220,80),
    healthLoColor = Color3.fromRGB(220,60,60),
    accentColor   = Color3.fromRGB(255,255,255),
    outlineColor  = Color3.fromRGB(40,40,52),
    skyColor      = Color3.fromRGB(0,100,200),
    ambientColor  = Color3.fromRGB(70,70,70),
    worldOn       = false,
    smokeOn       = false,
    flashOn       = false,
    wmOn          = true,
    kbListOn      = true,
    itemEspOn     = false,
    itemEspColor  = Color3.fromRGB(255,200,50),
    itemEspMaxDist= 200,
    itemEspShowDist= true,
    toggleKey     = "RightShift",
    tpKey         = "X",
}
local TARGET_OPTS = {"Closest","Head","HumanoidRootPart","UpperTorso","Torso"}
local KEY_OPTS    = {"RightShift","LeftShift","Insert","Delete","X","F1","F2","F3","F4","F5","F6"}
local CONFIG_DIR  = "BankrollCounterbloxCfg"
local MAIN_TABS = {"visuals","legitbot","movement","config"}
local TOP_TABS  = {"world","misc","semirage/rage"}
local CATS = MAIN_TABS
local function hsv2rgb(h,s,v)
    h=h%360; local i=math.floor(h/60); local f=h/60-i
    local p,q,t=v*(1-s),v*(1-f*s),v*(1-(1-f)*s)
    local lu={{v,t,p},{q,v,p},{p,v,t},{p,q,v},{t,p,v},{v,p,q}}
    local r,g,b=table.unpack(lu[(i%6)+1])
    return math.floor(r*255),math.floor(g*255),math.floor(b*255)
end
local function rgb2hsv(r,g,b)
    r,g,b=r/255,g/255,b/255
    local mx=math.max(r,g,b); local mn=math.min(r,g,b); local d=mx-mn
    local h=0
    if d>0 then
        if   mx==r then h=60*((g-b)/d%6)
        elseif mx==g then h=60*((b-r)/d+2)
        else              h=60*((r-g)/d+4) end
    end
    return h, mx==0 and 0 or d/mx, mx
end
local function c3hex(c)
    return string.format("#%02X%02X%02X",
        math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
end
local function sameTeam(p)
    return p.Team and lp.Team and p.Team==lp.Team
end
local function cfgSave(name)
    if name=="" then return end
    pcall(makefolder,CONFIG_DIR)
    local lines={}
    for k,v in pairs(cfg) do
        if type(v)=="boolean"   then lines[#lines+1]=k.."="..tostring(v)
        elseif type(v)=="number"  then lines[#lines+1]=k.."="..tostring(v)
        elseif type(v)=="string"  then lines[#lines+1]=k.."="..v
        elseif typeof(v)=="Color3" then
            lines[#lines+1]=k.."="..math.floor(v.R*255)..","
                              ..math.floor(v.G*255)..","..math.floor(v.B*255)
        end
    end
    pcall(writefile,CONFIG_DIR.."/"..name..".txt",table.concat(lines,"\n"))
end
local function cfgLoad(name)
    if name=="" then return end
    local ok,data=pcall(readfile,CONFIG_DIR.."/"..name..".txt")
    if not ok then return end
    for line in data:gmatch("[^\n]+") do
        local k,v=line:match("^(.-)=(.+)$")
        if k and v then
            if   v=="true"  then cfg[k]=true
            elseif v=="false" then cfg[k]=false
            elseif tonumber(v) then cfg[k]=tonumber(v)
            elseif v:match("^%d+,%d+,%d+$") then
                local r,g,b=v:match("(%d+),(%d+),(%d+)")
                cfg[k]=Color3.fromRGB(tonumber(r),tonumber(g),tonumber(b))
            else cfg[k]=v end
        end
    end
end
local function cfgList()
    local t={}
    pcall(function()
        pcall(makefolder,CONFIG_DIR)
        for _,f in ipairs(listfiles(CONFIG_DIR)) do
            local n=f:match("([^/\\]+)%.txt$")
            if n then
                local ok,data=pcall(readfile,CONFIG_DIR.."/"..n..".txt")
                if ok and data and #data>0 then
                    t[#t+1]=n
                end
            end
        end
    end)
    return t
end
local bhopAirSpeed=22
local flyConn=nil
local function startFly()
    local chr=lp.Character; if not chr then return end
    local hrp=chr:FindFirstChild("HumanoidRootPart"); if not hrp then return end
    local hum=chr:FindFirstChild("Humanoid"); if not hum then return end
    hum.PlatformStand=true
    local bg=Instance.new("BodyGyro"); bg.MaxTorque=Vector3.new(1e9,1e9,1e9); bg.P=1e5; bg.D=100; bg.Parent=hrp
    local bv=Instance.new("BodyVelocity"); bv.MaxForce=Vector3.new(1e9,1e9,1e9); bv.Velocity=Vector3.new(); bv.Parent=hrp
    flyConn=RunService.RenderStepped:Connect(function()
        if not cfg.flyOn then
            bg:Destroy(); bv:Destroy()
            hum.PlatformStand=false
            if flyConn then flyConn:Disconnect(); flyConn=nil end
            return
        end
        local cf=cam.CFrame
        local dir=Vector3.new()
        if UserInputService:IsKeyDown(Enum.KeyCode.W) then dir=dir+cf.LookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then dir=dir-cf.LookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then dir=dir-cf.RightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then dir=dir+cf.RightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then dir=dir+Vector3.new(0,1,0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then dir=dir-Vector3.new(0,1,0) end
        if dir.Magnitude>0 then dir=dir.Unit end
        bv.Velocity=dir*cfg.flySpeed
        bg.CFrame=cf
    end)
end
local function stopFly()
    cfg.flyOn=false
    local chr=lp.Character
    if chr then
        local hrp=chr:FindFirstChild("HumanoidRootPart")
        local hum=chr:FindFirstChild("Humanoid")
        if hrp then
            for _,v in ipairs(hrp:GetChildren()) do
                if v:IsA("BodyGyro") or v:IsA("BodyVelocity") then v:Destroy() end
            end
        end
        if hum then hum.PlatformStand=false end
    end
    if flyConn then flyConn:Disconnect(); flyConn=nil end
end
local spinConn=nil
local spinAngle=0
local function startSpin()
    if spinConn then return end
    spinConn=RunService.RenderStepped:Connect(function()
        if not cfg.antiAimOn then
            spinConn:Disconnect(); spinConn=nil
            spinAngle=0
            return
        end
        local chr=lp.Character; if not chr then return end
        local hrp=chr:FindFirstChild("HumanoidRootPart"); if not hrp then return end
        spinAngle=(spinAngle + cfg.spinSpeed * 10) % 360
        hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0, math.rad(spinAngle), 0)
    end)
end
local function stopSpin()
    cfg.antiAimOn=false
    spinAngle=0
    if spinConn then spinConn:Disconnect(); spinConn=nil end
end
RunService.Stepped:Connect(function()
    local chr=lp.Character; if not chr then return end
    local hum=chr:FindFirstChild("Humanoid")
    local hrp=chr:FindFirstChild("HumanoidRootPart")
    if not hum or not hrp then return end
    if cfg.bhop and UserInputService:IsKeyDown(Enum.KeyCode.Space) then
        local state=hum:GetState()
        if state==Enum.HumanoidStateType.Running
        or state==Enum.HumanoidStateType.RunningNoPhysics
        or state==Enum.HumanoidStateType.Landed then
            hum:ChangeState(Enum.HumanoidStateType.Jumping)
            if cfg.betterHop then
                bhopAirSpeed=17+math.random()*3
            end
        end
    end
    if cfg.betterHop and cfg.bhop then
        local state=hum:GetState()
        if state==Enum.HumanoidStateType.Freefall or state==Enum.HumanoidStateType.Jumping then
            hum.WalkSpeed=bhopAirSpeed
        else
            hum.WalkSpeed=16
        end
    end
end)
local cache={}
local skelCache={}
local bones={
    {"Head","UpperTorso"},{"UpperTorso","LowerTorso"},
    {"UpperTorso","LeftUpperArm"},{"LeftUpperArm","LeftLowerArm"},{"LeftLowerArm","LeftHand"},
    {"UpperTorso","RightUpperArm"},{"RightUpperArm","RightLowerArm"},{"RightLowerArm","RightHand"},
    {"LowerTorso","LeftUpperLeg"},{"LeftUpperLeg","LeftLowerLeg"},{"LeftLowerLeg","LeftFoot"},
    {"LowerTorso","RightUpperLeg"},{"RightUpperLeg","RightLowerLeg"},{"RightLowerLeg","RightFoot"},
}
local fovCircle=Drawing.new("Circle")
fovCircle.Visible=false; fovCircle.Thickness=1; fovCircle.NumSides=60
fovCircle.Filled=false; fovCircle.Transparency=1
local silentFovCircle=Drawing.new("Circle")
silentFovCircle.Visible=false; silentFovCircle.Thickness=1; silentFovCircle.NumSides=60
silentFovCircle.Filled=false; silentFovCircle.Transparency=1
pcall(function() setfpscap(500) end)
local wmBg=Drawing.new("Square")
wmBg.Visible=false; wmBg.Filled=true
wmBg.Color=Color3.fromRGB(10,10,13); wmBg.Transparency=0.65
wmBg.Position=Vector2.new(6,6)
local wmAccent=Drawing.new("Square")
wmAccent.Visible=false; wmAccent.Filled=true
wmAccent.Color=cfg.accentColor
wmAccent.Position=Vector2.new(6,6)
local wmLabel=Drawing.new("Text")
wmLabel.Visible=false; wmLabel.Size=13; wmLabel.Font=2
wmLabel.Outline=true; wmLabel.Color=Color3.fromRGB(220,220,220)
wmLabel.Position=Vector2.new(12,10)

local SG_W=200; local SG_H=50; local SG_MAX=40
local SG_X=8; local SG_Y=0
local sgBg=Drawing.new("Square"); sgBg.Filled=true; sgBg.Color=Color3.fromRGB(10,10,13); sgBg.Transparency=0.65; sgBg.Visible=false
local sgAccent=Drawing.new("Square"); sgAccent.Filled=true; sgAccent.Visible=false
local sgLabel=Drawing.new("Text"); sgLabel.Size=11; sgLabel.Font=2; sgLabel.Outline=true; sgLabel.Color=Color3.fromRGB(180,180,190); sgLabel.Visible=false
local sgSpeedLbl=Drawing.new("Text"); sgSpeedLbl.Size=11; sgSpeedLbl.Font=2; sgSpeedLbl.Outline=true; sgSpeedLbl.Color=Color3.fromRGB(220,220,220); sgSpeedLbl.Visible=false
local sgHistory={}
for i=1,SG_W do sgHistory[i]=0 end
local sgLines={}
for i=1,SG_W-1 do
    local l=Drawing.new("Line"); l.Visible=false; l.Thickness=1; l.Transparency=1
    l.Color=Color3.fromRGB(255,255,255)
    sgLines[i]=l
end
local function mkEsp(p)
    if cache[p.UserId] then return end
    local function sq() local d=Drawing.new("Square"); d.Visible=false; return d end
    local function tx()
        local d=Drawing.new("Text"); d.Visible=false
        d.Center=true; d.Outline=true; d.Size=13; d.Font=2; return d
    end
    local c={O=sq(),B=sq(),BF=sq(),HBg=sq(),HFi=sq(),HOut=sq(),Dist=tx(),Name=tx()}
    c.O.Color=Color3.new(0,0,0); c.O.Thickness=2; c.O.Filled=false
    c.B.Thickness=1; c.B.Filled=false
    c.BF.Filled=true; c.BF.Thickness=0
    c.HBg.Color=Color3.new(0,0,0); c.HBg.Filled=true; c.HBg.Transparency=.5
    c.HFi.Filled=true
    c.HOut.Color=Color3.new(0,0,0); c.HOut.Filled=false
    cache[p.UserId]=c
end
local function mkSkel(p)
    if skelCache[p.UserId] then return end
    local lines={}
    for _=1,#bones do
        local l=Drawing.new("Line")
        l.Visible=false; l.Thickness=1; l.Transparency=1
        lines[#lines+1]=l
    end
    skelCache[p.UserId]=lines
end
local function rmEsp(p)
    if not cache[p.UserId] then return end
    for _,d in pairs(cache[p.UserId]) do pcall(function() d:Remove() end) end
    cache[p.UserId]=nil
    if skelCache[p.UserId] then
        for _,l in pairs(skelCache[p.UserId]) do pcall(function() l:Remove() end) end
        skelCache[p.UserId]=nil
    end
end
local function checkVis(part)
    local o=cam.CFrame.Position
    local hit=workspace:FindPartOnRay(Ray.new(o,(part.Position-o).Unit*1000),lp.Character)
    return not hit or hit:IsDescendantOf(part.Parent)
end
local function getTarget()
    local best,bd=nil,fovCircle.Radius
    local mp=UserInputService:GetMouseLocation()
    for _,plr in ipairs(Players:GetPlayers()) do
        if plr~=lp and plr.Character then
            if cfg.teamCheck and sameTeam(plr) then continue end
            local hum=plr.Character:FindFirstChild("Humanoid")
            if hum and hum.Health>0 then
                local parts=cfg.targetPart=="Closest"
                    and {"Head","HumanoidRootPart","UpperTorso","Torso"}
                    or  {cfg.targetPart}
                for _,pn in ipairs(parts) do
                    local part=plr.Character:FindFirstChild(pn)
                    if part and (not cfg.visOnly or checkVis(part)) then
                        local sp,on=cam:WorldToViewportPoint(part.Position)
                        if on then
                            local d=(Vector2.new(sp.X,sp.Y)-mp).Magnitude
                            if d<bd then bd=d; best=part end
                        end
                    end
                end
            end
        end
    end
    return best
end
local triggerQueued=false
local triggerCooldown=false
RunService.RenderStepped:Connect(function()
    fovCircle.Position=UserInputService:GetMouseLocation()
    fovCircle.Visible=cfg.fovShow; fovCircle.Radius=cfg.fovRadius; fovCircle.Color=cfg.fovColor
    silentFovCircle.Position=UserInputService:GetMouseLocation()
    silentFovCircle.Visible=cfg.silentFovShow; silentFovCircle.Radius=getgenv().SilentAimSettings.FOVRadius; silentFovCircle.Color=cfg.silentFovColor
    if cfg.aimOn then
        local pressed=false
        if cfg.aimKey=="MouseButton1" then
            pressed=UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
        elseif cfg.aimKey=="MouseButton2" then
            pressed=UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)
        else
            local ok,kc=pcall(function() return Enum.KeyCode[cfg.aimKey] end)
            if ok then pressed=UserInputService:IsKeyDown(kc) end
        end
        local shouldAim = cfg.aimMode=="hold" and pressed or cfg.aimActive
        if shouldAim then
            local t=getTarget()
            if t then
                local tp,on=cam:WorldToViewportPoint(t.Position)
                if on then
                    local cur=UserInputService:GetMouseLocation()
                    local lerpT=1-((cfg.smoothness-1)/14)
                    local nw=cur:Lerp(Vector2.new(tp.X,tp.Y),math.clamp(lerpT,0.05,0.95))
                    mousemoverel(nw.X-cur.X,nw.Y-cur.Y)
                end
            end
        end
    end
    if cfg.triggerOn then
        local mouse=lp:GetMouse()
        local target=mouse.Target
        if target and target.Parent then
            local hum=target.Parent:FindFirstChildOfClass("Humanoid")
                or (target.Parent.Parent and target.Parent.Parent:FindFirstChildOfClass("Humanoid"))
            local targetPlr=Players:GetPlayerFromCharacter(target.Parent)
                or Players:GetPlayerFromCharacter(target.Parent.Parent)
            if hum and hum.Health>=1 and targetPlr and targetPlr~=lp then
                local skip=cfg.teamCheck and sameTeam(targetPlr)
                if not skip and not triggerCooldown then
                    triggerCooldown=true
                    task.delay(cfg.triggerDelay/1000, function()
                        if cfg.triggerOn then
                            mouse1press()
                            task.wait(0.05)
                            mouse1release()
                        end
                        triggerCooldown=false
                    end)
                end
            end
        end
    end
    if not cfg.espOn then
        for _,v in pairs(cache) do for _,d in pairs(v) do d.Visible=false end end
        for _,v in pairs(skelCache) do for _,l in pairs(v) do l.Visible=false end end
        return
    end
    for _,plr in ipairs(Players:GetPlayers()) do
        if plr~=lp and plr.Character then
            local shouldShow = not (cfg.teamCheck and sameTeam(plr))
            local hum=plr.Character:FindFirstChild("Humanoid")
            local root=plr.Character:FindFirstChild("HumanoidRootPart")
            local head=plr.Character:FindFirstChild("Head")
            if shouldShow and hum and root and head and hum.Health>0 then
                mkEsp(plr)
                local hp,hv=cam:WorldToViewportPoint(head.Position+Vector3.new(0,.5,0))
                local fp,fv=cam:WorldToViewportPoint(root.Position-Vector3.new(0,3,0))
                local rp,rv=cam:WorldToViewportPoint(root.Position)
                local c=cache[plr.UserId]
                if hv and fv and rv then
                    local w=root.Size.X*(1000/rp.Z)*1.2*1.1*1.2
                    local h=(hp.Y-fp.Y)*1.1
                    local x=rp.X; local top=(hp.Y+fp.Y)/2-h/2
                    c.O.Visible=false; c.B.Visible=false; c.BF.Visible=false
                    if cfg.boxOn then
                        c.O.Size=Vector2.new(w,h); c.O.Position=Vector2.new(x-w/2,top); c.O.Visible=true
                        c.B.Color=cfg.boxColor; c.B.Size=Vector2.new(w,h); c.B.Position=Vector2.new(x-w/2,top); c.B.Visible=true
                        if cfg.boxFillOn then
                            c.BF.Color=cfg.boxFillColor; c.BF.Transparency=0.6
                            c.BF.Size=Vector2.new(w,h); c.BF.Position=Vector2.new(x-w/2,top); c.BF.Visible=true
                        end
                    end
                    c.HBg.Visible=false; c.HFi.Visible=false; c.HOut.Visible=false
                    if cfg.healthOn then
                        local pct=hum.Health/hum.MaxHealth
                        local bW,bH=2,h; local fH=bH*pct; local bX=x-w/2-bW-3
                        c.HBg.Size=Vector2.new(bW,bH); c.HBg.Position=Vector2.new(bX,top); c.HBg.Visible=true
                        c.HFi.Size=Vector2.new(bW,fH); c.HFi.Position=Vector2.new(bX,top+(bH-fH))
                        c.HFi.Color=pct>.6 and Color3.fromRGB(0,255,0) or pct>.3 and Color3.fromRGB(255,255,0) or Color3.fromRGB(255,0,0)
                        c.HFi.Visible=true
                        c.HOut.Size=Vector2.new(bW+2,bH+2); c.HOut.Position=Vector2.new(bX-1,top-1); c.HOut.Visible=true
                    end
                    c.Dist.Visible=false
                    if cfg.distOn then
                        local mychr=lp.Character
                        if mychr and mychr:FindFirstChild("HumanoidRootPart") then
                            c.Dist.Color=cfg.distColor
                            c.Dist.Position=Vector2.new(x,fp.Y+15)
                            c.Dist.Text=math.floor((root.Position-mychr.HumanoidRootPart.Position).Magnitude).."m"
                            c.Dist.Visible=true
                        end
                    end
                    c.Name.Visible=false
                    if cfg.nameOn then
                        c.Name.Color=cfg.nameColor; c.Name.Position=Vector2.new(x,hp.Y-25); c.Name.Text=plr.Name; c.Name.Visible=true
                    end
                else
                    for _,d in pairs(c) do d.Visible=false end
                end
                if cfg.skelOn then
                    mkSkel(plr)
                    local lines=skelCache[plr.UserId]
                    for i,bone in ipairs(bones) do
                        local p1=plr.Character:FindFirstChild(bone[1])
                        local p2=plr.Character:FindFirstChild(bone[2])
                        if p1 and p2 then
                            local s1,v1=cam:WorldToViewportPoint(p1.Position)
                            local s2,v2=cam:WorldToViewportPoint(p2.Position)
                            if v1 and v2 then
                                lines[i].From=Vector2.new(s1.X,s1.Y)
                                lines[i].To=Vector2.new(s2.X,s2.Y)
                                lines[i].Color=cfg.skelColor
                                lines[i].Visible=true
                            else
                                lines[i].Visible=false
                            end
                        else
                            if skelCache[plr.UserId] then skelCache[plr.UserId][i].Visible=false end
                        end
                    end
                else
                    if skelCache[plr.UserId] then
                        for _,l in pairs(skelCache[plr.UserId]) do l.Visible=false end
                    end
                end
            else
                if cache[plr.UserId] then for _,d in pairs(cache[plr.UserId]) do d.Visible=false end end
                if skelCache[plr.UserId] then for _,l in pairs(skelCache[plr.UserId]) do l.Visible=false end end
            end
        end
    end
end)
Players.PlayerRemoving:Connect(rmEsp)
for _,v in ipairs(Players:GetPlayers()) do if v~=lp then mkEsp(v) end end
Players.PlayerAdded:Connect(function(v) if v~=lp then mkEsp(v) end end)
lp.CharacterAdded:Connect(function()
    if flyConn then flyConn:Disconnect(); flyConn=nil end
    if cfg.flyOn then task.wait(0.5); startFly() end
    if spinConn then spinConn:Disconnect(); spinConn=nil end
    spinAngle=0
    if cfg.antiAimOn then task.wait(0.5); startSpin() end
end)

local itemLabels={}
local function getOrMakeLabel(key)
    if not itemLabels[key] then
        local t=Drawing.new("Text")
        t.Visible=false; t.Center=true; t.Outline=true
        t.Size=13; t.Font=2
        itemLabels[key]=t
    end
    return itemLabels[key]
end
RunService.RenderStepped:Connect(function()
    for k,l in pairs(itemLabels) do l.Visible=false end
    if not cfg.itemEspOn then return end
    local mychr=lp.Character
    local myroot=mychr and mychr:FindFirstChild("HumanoidRootPart")
    if not myroot then return end
    local ok,debris=pcall(function() return workspace.Debris end)
    if not ok or not debris then return end
    local idx=0
    for _,obj in ipairs(debris:GetChildren()) do
        if not obj:IsA("BasePart") then continue end
        local pos=obj.Position
        local dist=(pos-myroot.Position).Magnitude
        if dist<=cfg.itemEspMaxDist then
            local sp,sv=cam:WorldToViewportPoint(pos)
            if sv then
                idx=idx+1
                local lbl=getOrMakeLabel(idx)
                lbl.Text=obj.Name..(cfg.itemEspShowDist and " ["..math.floor(dist).."m]" or "")
                lbl.Color=cfg.itemEspColor
                lbl.Position=Vector2.new(sp.X,sp.Y)
                lbl.Visible=true
            end
        end
    end
end)
getgenv().SilentAimSettings = {
    Enabled = false,
    TeamCheck = false,
    VisibleCheck = false,
    AliveCheck = true,
    TargetPart = "Head",
    FOVRadius = 120,
    HitChance = 100,
}
local _saCamera = workspace.CurrentCamera
local _saLocalPlayer = Players.LocalPlayer
local _saRandom = {"Head","HumanoidRootPart"}
local function saScreenPoint(p) local v,vis=_saCamera:WorldToScreenPoint(p); return Vector2.new(v.X,v.Y),vis end
local function saDir(p1,p2) return (p2-p1).Unit end
local function saMouse() return UserInputService:GetMouseLocation() end
local function saTeam(p) return p.Team==_saLocalPlayer.Team end
local function saVisible(p)
    local c=p.Character; local c2=_saLocalPlayer.Character
    if c and c2 then
        local v=c:FindFirstChild("Head") or c:FindFirstChild("HumanoidRootPart")
        if v then return #_saCamera:GetPartsObscuringTarget({v.Position,c2,c},{c2,c})==0 else return false end
    else return false end
end
local function saFindTarget()
    local tp=getgenv().SilentAimSettings.TargetPart
    local fov=cfg.ignoreFov and math.huge or getgenv().SilentAimSettings.FOVRadius
    local vis=getgenv().SilentAimSettings.VisibleCheck
    local alive=getgenv().SilentAimSettings.AliveCheck
    local tc=getgenv().SilentAimSettings.TeamCheck
    local mp=saMouse()
    local bestDist,bestPart,bestPlr=nil,nil,nil
    for _,plr in ipairs(Players:GetPlayers()) do
        if plr~=_saLocalPlayer and not(tc and saTeam(plr)) and (not vis or saVisible(plr)) then
            local chr=plr.Character
            if chr then
                local hrp=chr:FindFirstChild("HumanoidRootPart")
                local hum=chr:FindFirstChild("Humanoid")
                if hrp and hum and (not alive or hum.Health>0) then
                    local sp,sv=saScreenPoint(hrp.Position)
                    if sv then
                        local d=(mp-sp).Magnitude
                        if d<=(bestDist or fov) then
                            local partName=tp=="Random" and (_saRandom[math.random(1,#_saRandom)] or tp) or tp
                            local part=chr:FindFirstChild(partName)
                            if part then bestDist=d; bestPart=part; bestPlr=plr end
                        end
                    end
                end
            end
        end
    end
    return bestPart,bestPlr
end
local saTarget=nil
RunService.Heartbeat:Connect(function()
    if getgenv().SilentAimSettings.Enabled then
        getgenv().SilentAimSettings.TeamCheck=cfg.teamCheck
        getgenv().SilentAimSettings.VisibleCheck=cfg.visOnly
        saTarget=saFindTarget()
    else saTarget=nil end
end)
local saHook=nil
saHook=hookmetamethod(game,"__namecall",newcclosure(function(...)
    local method=getnamecallmethod()
    local args={...}
    local self=args[1]
    if method=="Destroy" and self==_saLocalPlayer then return saHook(...) end
    if ({})[method] then return saHook(...) end
    if not getgenv().SilentAimSettings.Enabled then return saHook(...) end
    if not(math.random()*100<=getgenv().SilentAimSettings.HitChance) then return saHook(...) end
    if checkcaller() then return saHook(...) end
    local target=method=="FindPartOnRayWithIgnoreList" and saTarget
    if not target then return saHook(...) end
    local ray=args[2]
    if typeof(ray)=="Ray" then
        local dir=saDir(ray.Origin,target.Position)*1000
        args[2]=Ray.new(ray.Origin,dir)
    end
    return saHook(unpack(args))
end))
local silentTarget=nil
local function saHitChance(p) return math.random()*100<=p end
local function saUnitDir(p1,p2) return (p2-p1).Unit end
RunService.Heartbeat:Connect(function()
    if not cfg.silentOn then silentTarget=nil; return end
    local mp=UserInputService:GetMouseLocation()
    local best,bd=nil,cfg.silentFov
    for _,plr in ipairs(Players:GetPlayers()) do
        if plr==lp or not plr.Character then continue end
        if cfg.teamCheck and sameTeam(plr) then continue end
        local hum=plr.Character:FindFirstChild("Humanoid")
        if not hum or hum.Health<=0 then continue end
        local hrp=plr.Character:FindFirstChild("HumanoidRootPart"); if not hrp then continue end
        local sp,sv=cam:WorldToViewportPoint(hrp.Position)
        if sv then
            local d=(mp-Vector2.new(sp.X,sp.Y)).Magnitude
            if d<bd then
                local RANDOM_PARTS={"Head","UpperTorso","LowerTorso","Torso","HumanoidRootPart",
                    "LeftUpperArm","RightUpperArm","LeftLowerArm","RightLowerArm",
                    "LeftUpperLeg","RightUpperLeg","LeftLowerLeg","RightLowerLeg"}
                local partName=cfg.silentTarget=="Random" and RANDOM_PARTS[math.random(#RANDOM_PARTS)] or cfg.silentTarget
                local part=plr.Character:FindFirstChild(partName) or plr.Character:FindFirstChild("Head")
                if part then bd=d; best=part end
            end
        end
    end
    silentTarget=best
end)
local saHook=nil
saHook=hookmetamethod(game,"__namecall",newcclosure(function(...)
    local v58=getnamecallmethod()
    local v59={...}
    local v60=v59[1]
    if v58~="Destroy" or v60~=lp then
        if ({})[v58] then return saHook(...) end
        local v61=saHitChance(cfg.silentHitChance)
        if not cfg.silentOn or (not v61 or checkcaller()) then return saHook(...) end
        local v62=v58=="FindPartOnRayWithIgnoreList" and silentTarget
        if not v62 then return saHook(...) end
        local v63=v59[2]
        if typeof(v63)=="Ray" then
            local origin=v63.Origin
            local v65=saUnitDir(origin,v62.Position)*1000
            v59[2]=Ray.new(origin,v65)
        end
        return saHook(unpack(v59))
    end
end))
local afLastFire=0
local afTarget=nil
local afChar=nil
local afHum=nil
local afSpaceDown=false
local afConn=nil
local function afCheckVis(plr)
    local chr=plr.Character
    local mychr=lp.Character
    if chr and mychr then
        local head=chr:FindFirstChild("Head") or chr:FindFirstChild("HumanoidRootPart")
        if head then
            return #cam:GetPartsObscuringTarget({head.Position,mychr.Head and mychr.Head.Position or mychr.HumanoidRootPart.Position},{mychr,chr})==0
        end
    end
    return false
end
local function afFindTarget()
    for _,plr in ipairs(Players:GetPlayers()) do
        if plr~=lp and not sameTeam(plr) then
            local chr=plr.Character
            if chr then
                local hum=chr:FindFirstChild("Humanoid")
                if hum and hum.Health>0 and chr:FindFirstChild("Head") and afCheckVis(plr) then
                    return plr
                end
            end
        end
    end
    return nil
end
local function afFire()
    if afTarget and afChar and afHum then
        if afHum.Health>0 then
            if afCheckVis(afTarget) then
                if sameTeam(afTarget) then
                    afTarget=nil; afChar=nil; afHum=nil
                elseif tick()-afLastFire>=0.1 then
                    mouse1press(); task.wait(0.01); mouse1release()
                    afLastFire=tick()
                end
            else
                afTarget=nil; afChar=nil; afHum=nil
            end
        else
            afTarget=nil; afChar=nil; afHum=nil
        end
    end
end
local function afStart()
    if afConn then return end
    afConn=RunService.Heartbeat:Connect(function()
        if not cfg.autoFireOn then return end
        if not getgenv().SilentAimSettings.Enabled then return end
        if afTarget and afChar and afHum then
            afFire()
        else
            local t=afFindTarget()
            if t then
                afTarget=t; afChar=t.Character; afHum=afChar:FindFirstChild("Humanoid")
            end
        end
    end)
end
afStart()
local gui=Instance.new("ScreenGui")
gui.Name="BankrollESP"; gui.ResetOnSpawn=false
gui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling; gui.DisplayOrder=99
if not pcall(function() gui.Parent=game:GetService("CoreGui") end) then
    gui.Parent=lp:WaitForChild("PlayerGui")
end

local kbGui=Instance.new("ScreenGui")
kbGui.Name="BankrollKB"; kbGui.ResetOnSpawn=false
kbGui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling; kbGui.DisplayOrder=98
if not pcall(function() kbGui.Parent=game:GetService("CoreGui") end) then
    kbGui.Parent=lp:WaitForChild("PlayerGui")
end
local kbFrame=Instance.new("Frame")
kbFrame.BackgroundColor3=Color3.fromRGB(22,22,26)
kbFrame.BorderSizePixel=0
kbFrame.Position=UDim2.new(0,8,0.5,-40)
kbFrame.Size=UDim2.new(0,160,0,20)
kbFrame.Visible=false
kbFrame.Parent=kbGui
local kbCorner=Instance.new("UICorner"); kbCorner.CornerRadius=UDim.new(0,5); kbCorner.Parent=kbFrame
local kbTopLine=Instance.new("Frame")
kbTopLine.BackgroundColor3=cfg.accentColor
kbTopLine.BorderSizePixel=0
kbTopLine.Size=UDim2.new(1,0,0,2)
kbTopLine.Position=UDim2.new(0,0,0,0)
kbTopLine.ZIndex=2
kbTopLine.Parent=kbFrame
local kbCorner2=Instance.new("UICorner"); kbCorner2.CornerRadius=UDim.new(0,5); kbCorner2.Parent=kbTopLine
local kbTitleLbl=Instance.new("TextLabel")
kbTitleLbl.BackgroundTransparency=1; kbTitleLbl.BorderSizePixel=0
kbTitleLbl.Size=UDim2.new(1,0,0,16); kbTitleLbl.Position=UDim2.new(0,8,0,4)
kbTitleLbl.Text="Keybinds"; kbTitleLbl.TextColor3=Color3.fromRGB(130,130,145)
kbTitleLbl.TextSize=11; kbTitleLbl.Font=Enum.Font.GothamBold
kbTitleLbl.TextXAlignment=Enum.TextXAlignment.Left
kbTitleLbl.ZIndex=3; kbTitleLbl.Parent=kbFrame
local kbRows={}
local kbDragging,kbDragStart,kbFrameStart=false,Vector2.new(),Vector2.new()
kbFrame.InputBegan:Connect(function(i)
    if i.UserInputType==Enum.UserInputType.MouseButton1 then
        kbDragging=true
        kbDragStart=Vector2.new(i.Position.X,i.Position.Y)
        kbFrameStart=Vector2.new(kbFrame.AbsolutePosition.X,kbFrame.AbsolutePosition.Y)
    end
end)
UserInputService.InputChanged:Connect(function(i)
    if kbDragging and i.UserInputType==Enum.UserInputType.MouseMovement then
        local d=Vector2.new(i.Position.X,i.Position.Y)-kbDragStart
        kbFrame.Position=UDim2.new(0,kbFrameStart.X+d.X,0,kbFrameStart.Y+d.Y)
    end
end)
UserInputService.InputEnded:Connect(function(i)
    if i.UserInputType==Enum.UserInputType.MouseButton1 then kbDragging=false end
end)
local function rebuildKbPanel()
    for _,r in ipairs(kbRows) do r:Destroy() end
    kbRows={}
    if not cfg.kbListOn then kbFrame.Visible=false; return end
    local entries={}
    if cfg.aimOn then table.insert(entries,{name="Aimbot",      key=cfg.aimKey}) end
    if getgenv().SilentAimSettings and getgenv().SilentAimSettings.Enabled and cfg.silentKey~="none" then table.insert(entries,{name="Silent Aim", key=cfg.silentKey}) end
    if cfg.flyEnabled then table.insert(entries,{name="Fly",key=cfg.flyKey}) end
    do local ok,v=pcall(function() return workspace.ThirdPerson.Value end)
        if ok and v then table.insert(entries,{name="3rd Person",key=cfg.tpKey}) end
    end
    table.insert(entries,{name="Menu",key=cfg.toggleKey})
    if #entries==0 then kbFrame.Visible=false; return end
    local rowH=16
    local totalH=22+#entries*rowH+4
    kbFrame.Size=UDim2.new(0,160,0,totalH)
    kbTopLine.BackgroundColor3=cfg.accentColor
    for i,e in ipairs(entries) do
        local row=Instance.new("Frame")
        row.BackgroundTransparency=1; row.BorderSizePixel=0
        row.Size=UDim2.new(1,-16,0,rowH)
        row.Position=UDim2.new(0,8,0,18+(i-1)*rowH)
        row.ZIndex=3; row.Parent=kbFrame
        table.insert(kbRows,row)
        local nameLbl=Instance.new("TextLabel")
        nameLbl.BackgroundTransparency=1; nameLbl.BorderSizePixel=0
        nameLbl.Size=UDim2.new(0.6,0,1,0); nameLbl.Position=UDim2.new(0,0,0,0)
        nameLbl.Text=e.name
        nameLbl.TextColor3=Color3.fromRGB(190,190,200)
        nameLbl.TextSize=10; nameLbl.Font=Enum.Font.GothamMedium
        nameLbl.TextXAlignment=Enum.TextXAlignment.Left
        nameLbl.ZIndex=4; nameLbl.Parent=row
        local keyLblKb=Instance.new("TextLabel")
        keyLblKb.BackgroundTransparency=1; keyLblKb.BorderSizePixel=0
        keyLblKb.Size=UDim2.new(0.4,0,1,0); keyLblKb.Position=UDim2.new(0.6,0,0,0)
        keyLblKb.Text="["..e.key.."]"
        keyLblKb.TextColor3=cfg.accentColor
        keyLblKb.TextSize=10; keyLblKb.Font=Enum.Font.GothamMedium
        keyLblKb.TextXAlignment=Enum.TextXAlignment.Right
        keyLblKb.ZIndex=4; keyLblKb.Parent=row
    end
    kbFrame.Visible=true
end
local BG    = Color3.fromRGB(15,15,18)
local BG2   = Color3.fromRGB(20,20,25)
local ROW   = Color3.fromRGB(23,23,29)
local BDR   = Color3.fromRGB(38,38,48)
local DIM   = Color3.fromRGB(85,85,100)
local WHITE = Color3.fromRGB(210,210,220)
local function uiStroke(p,col,th)
    local s=Instance.new("UIStroke"); s.Color=col; s.Thickness=th or 1; s.Parent=p; return s
end
local function uiCorner(p,r)
    local c=Instance.new("UICorner"); c.CornerRadius=UDim.new(0,r or 3); c.Parent=p
end
local function mkFrame(par,bg,sz,pos,clip)
    local f=Instance.new("Frame"); f.BackgroundColor3=bg; f.BorderSizePixel=0
    f.Size=sz; f.Position=pos; if clip then f.ClipsDescendants=true end; f.Parent=par; return f
end
local function mkLabel(par,txt,sz,pos,col,fs,xa)
    local l=Instance.new("TextLabel"); l.BackgroundTransparency=1; l.BorderSizePixel=0
    l.Text=txt; l.TextColor3=col or WHITE; l.TextSize=fs or 12
    l.Font=Enum.Font.GothamMedium
    l.TextXAlignment=xa or Enum.TextXAlignment.Left
    l.Size=sz; l.Position=pos; l.Parent=par; return l
end
local function mkBtn(par,txt,bg,sz,pos,fn)
    local b=Instance.new("TextButton"); b.BackgroundColor3=bg; b.BorderSizePixel=0
    b.Text=txt; b.TextColor3=WHITE; b.TextSize=11; b.Font=Enum.Font.GothamMedium
    b.Size=sz; b.Position=pos; b.Parent=par
    if fn then b.MouseButton1Click:Connect(fn) end; return b
end
local WIN_W,WIN_H = 380,360
local window=mkFrame(gui,BG,UDim2.new(0,WIN_W,0,WIN_H),UDim2.new(0,100,0,80),false)
local winStroke=uiStroke(window,cfg.outlineColor,1)
local topLine=mkFrame(window,cfg.accentColor,UDim2.new(1,0,0,2),UDim2.new(0,0,0,0))
topLine.Name="TopLine"
local titleBar=mkFrame(window,BG2,UDim2.new(1,0,0,24),UDim2.new(0,0,0,2))
mkLabel(titleBar,"Bankroll",UDim2.new(1,0,1,0),UDim2.new(0,0,0,0),WHITE,12,Enum.TextXAlignment.Center)
local keyLbl=mkLabel(titleBar,"[RShift]",UDim2.new(0,70,1,0),UDim2.new(1,-72,0,0),DIM,9,Enum.TextXAlignment.Right)
local dragging,dragStart,winStart=false,Vector2.new(),Vector2.new()
titleBar.InputBegan:Connect(function(i)
    if i.UserInputType==Enum.UserInputType.MouseButton1 then
        dragging=true
        dragStart=Vector2.new(i.Position.X,i.Position.Y)
        winStart=Vector2.new(window.AbsolutePosition.X,window.AbsolutePosition.Y)
    end
end)
UserInputService.InputChanged:Connect(function(i)
    if dragging and i.UserInputType==Enum.UserInputType.MouseMovement then
        local d=Vector2.new(i.Position.X,i.Position.Y)-dragStart
        window.Position=UDim2.new(0,winStart.X+d.X,0,winStart.Y+d.Y)
    end
end)
UserInputService.InputEnded:Connect(function(i)
    if i.UserInputType==Enum.UserInputType.MouseButton1 then dragging=false end
end)
local topBarH=20
local tabBarH=22
local topBar=mkFrame(window,Color3.fromRGB(11,11,14),UDim2.new(1,0,0,topBarH),UDim2.new(0,0,1,-(topBarH+tabBarH)))
mkFrame(topBar,BDR,UDim2.new(1,0,0,1),UDim2.new(0,0,0,0))
local tabBar=mkFrame(window,BG,UDim2.new(1,0,0,tabBarH),UDim2.new(0,0,1,-tabBarH))
mkFrame(tabBar,BDR,UDim2.new(1,0,0,1),UDim2.new(0,0,0,0))
local tabBtns={}
local topBtns={}
local contentY=26
local contentArea=mkFrame(window,BG,UDim2.new(1,0,0,WIN_H-contentY-topBarH-tabBarH),UDim2.new(0,0,0,contentY),true)
local PK_SQ=148; local PK_HW=14
local PK_W=PK_SQ+PK_HW+18; local PK_H=PK_SQ+30
local picker=Instance.new("Frame")
picker.Name="ColorPicker"
picker.BackgroundColor3=Color3.fromRGB(18,18,22); picker.BorderSizePixel=0
picker.Size=UDim2.new(0,PK_W,0,PK_H); picker.Visible=false; picker.ZIndex=50
uiStroke(picker,BDR,1)
local sbF=mkFrame(picker,Color3.new(1,1,1),UDim2.new(0,PK_SQ,0,PK_SQ),UDim2.new(0,6,0,6))
sbF.ZIndex=50
local huOvr=mkFrame(sbF,Color3.fromHSV(0,1,1),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
huOvr.ZIndex=51
local g1=Instance.new("UIGradient")
g1.Color=ColorSequence.new({
    ColorSequenceKeypoint.new(0,Color3.new(1,1,1)),
    ColorSequenceKeypoint.new(1,Color3.new(1,1,1)),
})
g1.Transparency=NumberSequence.new({
    NumberSequenceKeypoint.new(0,1),
    NumberSequenceKeypoint.new(1,0),
})
g1.Rotation=0; g1.Parent=huOvr
local blOvr=mkFrame(sbF,Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
blOvr.ZIndex=52; blOvr.BackgroundTransparency=1
local g2=Instance.new("UIGradient")
g2.Color=ColorSequence.new(Color3.new(0,0,0))
g2.Transparency=NumberSequence.new({
    NumberSequenceKeypoint.new(0,1),
    NumberSequenceKeypoint.new(1,0),
})
g2.Rotation=90; g2.Parent=blOvr
local sbCur=Instance.new("Frame")
sbCur.BackgroundColor3=Color3.new(1,1,1); sbCur.BorderSizePixel=0
sbCur.Size=UDim2.new(0,9,0,9); sbCur.ZIndex=55; sbCur.Parent=sbF
uiCorner(sbCur,9); uiStroke(sbCur,Color3.new(0,0,0),1)
local hueS=mkFrame(picker,Color3.new(1,1,1),UDim2.new(0,PK_HW,0,PK_SQ),UDim2.new(0,6+PK_SQ+6,0,6))
hueS.ZIndex=50
local hG=Instance.new("UIGradient")
hG.Color=ColorSequence.new({
    ColorSequenceKeypoint.new(0,    Color3.fromHSV(0,1,1)),
    ColorSequenceKeypoint.new(1/6,  Color3.fromHSV(1/6,1,1)),
    ColorSequenceKeypoint.new(2/6,  Color3.fromHSV(2/6,1,1)),
    ColorSequenceKeypoint.new(3/6,  Color3.fromHSV(3/6,1,1)),
    ColorSequenceKeypoint.new(4/6,  Color3.fromHSV(4/6,1,1)),
    ColorSequenceKeypoint.new(5/6,  Color3.fromHSV(5/6,1,1)),
    ColorSequenceKeypoint.new(1,    Color3.fromHSV(0,1,1)),
})
hG.Rotation=90; hG.Parent=hueS
local hueCur=mkFrame(hueS,Color3.new(1,1,1),UDim2.new(1,4,0,2),UDim2.new(0,-2,0,0))
hueCur.ZIndex=55
local pkPrev=mkFrame(picker,Color3.new(1,1,1),UDim2.new(0,24,0,16),UDim2.new(0,6,0,6+PK_SQ+7))
pkPrev.ZIndex=50; uiStroke(pkPrev,BDR,1)
local pkHex=mkLabel(picker,"#FFFFFF",UDim2.new(1,-38,0,16),UDim2.new(0,34,0,6+PK_SQ+7),DIM,10)
pkHex.ZIndex=50
local pkKey=nil
local pkH,pkS,pkV=0,1,1
local pkDragSB=false; local pkDragHue=false
local function pkRefresh()
    huOvr.BackgroundColor3=Color3.fromHSV(pkH/360,1,1)
    sbCur.Position=UDim2.new(pkS,-4,1-pkV,-4)
    hueCur.Position=UDim2.new(0,-2,pkH/360,-1)
    local r,g,b=hsv2rgb(pkH,pkS,pkV)
    local col=Color3.fromRGB(r,g,b)
    pkPrev.BackgroundColor3=col
    pkHex.Text=c3hex(col)
    if pkKey then cfg[pkKey]=col end
end
sbF.InputBegan:Connect(function(i)
    if i.UserInputType~=Enum.UserInputType.MouseButton1 then return end
    pkDragSB=true
    local a=sbF.AbsolutePosition; local s=sbF.AbsoluteSize
    pkS=math.clamp((i.Position.X-a.X)/s.X,0,1)
    pkV=1-math.clamp((i.Position.Y-a.Y)/s.Y,0,1)
    pkRefresh()
end)
hueS.InputBegan:Connect(function(i)
    if i.UserInputType~=Enum.UserInputType.MouseButton1 then return end
    pkDragHue=true
    local a=hueS.AbsolutePosition; local s=hueS.AbsoluteSize
    pkH=math.clamp((i.Position.Y-a.Y)/s.Y,0,1)*360
    pkRefresh()
end)
UserInputService.InputChanged:Connect(function(i)
    if i.UserInputType~=Enum.UserInputType.MouseMovement then return end
    if pkDragSB then
        local a=sbF.AbsolutePosition; local s=sbF.AbsoluteSize
        pkS=math.clamp((i.Position.X-a.X)/s.X,0,1)
        pkV=1-math.clamp((i.Position.Y-a.Y)/s.Y,0,1)
        pkRefresh()
    elseif pkDragHue then
        local a=hueS.AbsolutePosition; local s=hueS.AbsoluteSize
        pkH=math.clamp((i.Position.Y-a.Y)/s.Y,0,1)*360
        pkRefresh()
    end
end)
UserInputService.InputEnded:Connect(function(i)
    if i.UserInputType==Enum.UserInputType.MouseButton1 then
        pkDragSB=false; pkDragHue=false
    end
end)
local function openPicker(key, scroll, anchorY)
    if pkKey==key then
        pkKey=nil; picker.Visible=false; return false
    end
    pkKey=key
    local c=cfg[key]
    pkH,pkS,pkV=rgb2hsv(math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
    picker.Parent=scroll
    picker.Position=UDim2.new(0,16,0,anchorY)
    picker.Visible=true
    picker.ZIndex=50
    pkRefresh()
    return true
end
local curCat="visuals"
local curTab="visuals"
local rebuild
rebuild=function()
    for _,ch in ipairs(contentArea:GetChildren()) do ch:Destroy() end
    picker.Visible=false; pkKey=nil
    topLine.BackgroundColor3=cfg.accentColor
    winStroke.Color=cfg.outlineColor
    keyLbl.Text="["..cfg.toggleKey.."]"
    local allTabs = {}
    for _,t in ipairs(MAIN_TABS) do allTabs[#allTabs+1]=t end
    for _,t in ipairs(TOP_TABS)  do allTabs[#allTabs+1]=t end
    for _,t in ipairs(allTabs) do
        local b=tabBtns[t] or topBtns[t]
        if b then
            local on=(t==curTab)
            b.BackgroundColor3=on and BG2 or (topBtns[t] and Color3.fromRGB(11,11,14) or BG)
            b.TextColor3=on and WHITE or DIM
            if b:FindFirstChild("UL") then b.UL:Destroy() end
            if on then
                local ul=mkFrame(b,cfg.accentColor,UDim2.new(1,0,0,2),UDim2.new(0,0,0,0))
                ul.Name="UL"
            end
        end
    end
    local scroll=Instance.new("ScrollingFrame")
    scroll.BackgroundColor3=BG; scroll.BorderSizePixel=0
    scroll.Size=UDim2.new(1,0,1,0); scroll.Position=UDim2.new(0,0,0,0)
    scroll.ScrollBarThickness=3; scroll.ScrollBarImageColor3=BDR
    scroll.CanvasSize=UDim2.new(0,0,0,0)
    scroll.ScrollingDirection=Enum.ScrollingDirection.Y
    scroll.Parent=contentArea
    local y=8
    local function header(txt)
        mkLabel(scroll,txt,UDim2.new(1,-20,0,14),UDim2.new(0,10,0,y),DIM,9)
        y=y+16
    end
    local function sep()
        y=y+4
        mkFrame(scroll,Color3.fromRGB(28,28,35),UDim2.new(1,-20,0,1),UDim2.new(0,10,0,y))
        y=y+8
    end
    local function togRow(label,key,colorKey)
        local rowH=22
        local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
        row.BackgroundTransparency=1
        local on=cfg[key]
        if on then
            mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5))
        end
        mkLabel(row,label,UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)

        local chk=mkFrame(row, on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),
            UDim2.new(0,10,0,10), UDim2.new(1,-14,0.5,-5))
        uiCorner(chk,2)
        chk.ZIndex=3

        if colorKey then
            local sw=mkFrame(row,cfg[colorKey],UDim2.new(0,10,0,10),UDim2.new(1,-28,0.5,-5))
            uiCorner(sw,2)
            sw.ZIndex=4
            local swBtn=mkBtn(sw,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            swBtn.BackgroundTransparency=1
            swBtn.ZIndex=6
            local anchorY=y+rowH+2
            swBtn.MouseButton1Click:Connect(function()
                if pkKey==colorKey then pkKey=nil; picker.Visible=false
                else
                    pkKey=colorKey
                    local c=cfg[colorKey]
                    pkH,pkS,pkV=rgb2hsv(math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
                    picker.Parent=scroll
                    picker.Position=UDim2.new(0,10,0,anchorY)
                    picker.Visible=true; picker.ZIndex=50; pkRefresh()
                end
            end)
        end

        local chkBtn=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
        chkBtn.BackgroundTransparency=1
        chkBtn.ZIndex=5
        chkBtn.MouseButton1Click:Connect(function()
            cfg[key]=not cfg[key]; rebuild()
        end)

        local labelEndX = colorKey and -42 or -22
        local labelBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,labelEndX,1,0),UDim2.new(0,0,0,0))
        labelBtn.BackgroundTransparency=1
        labelBtn.ZIndex=3
        labelBtn.MouseButton1Click:Connect(function()
            cfg[key]=not cfg[key]; rebuild()
        end)

        y=y+rowH+1
    end
    local function sldRow(label,key,mn,mx2)
        local rowH=32
        local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
        row.BackgroundTransparency=1
        mkLabel(row,label,UDim2.new(0.7,0,0,14),UDim2.new(0,10,0,2),DIM,11)
        local vLbl=mkLabel(row,tostring(math.floor(cfg[key])),UDim2.new(0.3,-10,0,14),UDim2.new(0.7,0,0,2),cfg.accentColor,11,Enum.TextXAlignment.Right)
        local trk=mkFrame(row,Color3.fromRGB(32,32,40),UDim2.new(1,-20,0,3),UDim2.new(0,10,0,20))
        uiCorner(trk,2)
        local pct=math.clamp((cfg[key]-mn)/(mx2-mn),0,1)
        local fil=mkFrame(trk,cfg.accentColor,UDim2.new(pct,0,1,0),UDim2.new(0,0,0,0)); uiCorner(fil,2)
        local thb=mkFrame(trk,WHITE,UDim2.new(0,8,0,8),UDim2.new(pct,-4,0.5,-4)); uiCorner(thb,9)
        local sd=false
        local function upd(mx)
            local a=trk.AbsolutePosition; local s=trk.AbsoluteSize
            local p=math.clamp((mx-a.X)/s.X,0,1)
            cfg[key]=mn+(mx2-mn)*p
            fil.Size=UDim2.new(p,0,1,0); thb.Position=UDim2.new(p,-4,0.5,-4)
            vLbl.Text=tostring(math.floor(cfg[key]))
        end
        trk.InputBegan:Connect(function(i)
            if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=true; upd(i.Position.X) end
        end)
        UserInputService.InputChanged:Connect(function(i)
            if sd and i.UserInputType==Enum.UserInputType.MouseMovement then upd(i.Position.X) end
        end)
        UserInputService.InputEnded:Connect(function(i)
            if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=false end
        end)
        y=y+rowH+2
    end
    local function dropRow(label,key,opts,onChanged)
        local rowH=22
        local ITEM_H=20
        local fullListH=#opts*ITEM_H
        local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
        row.BackgroundTransparency=1
        mkLabel(row,label,UDim2.new(0.45,0,1,0),UDim2.new(0,10,0,0),DIM,11)
        local valBtn=mkBtn(row,cfg[key],Color3.fromRGB(22,22,28),UDim2.new(0,140,0,18),UDim2.new(1,-148,0.5,-9))
        valBtn.TextSize=10; valBtn.TextColor3=WHITE
        uiStroke(valBtn,Color3.fromRGB(35,35,45),1)
        local listY=y+rowH+1
        local listFrame=mkFrame(scroll,Color3.fromRGB(20,20,26),UDim2.new(1,-20,0,0),UDim2.new(0,10,0,listY))
        uiStroke(listFrame,Color3.fromRGB(35,35,45),1)
        listFrame.ClipsDescendants=true; listFrame.ZIndex=40
        local listOpen=false
        local function refreshItems()
            for _,ch in ipairs(listFrame:GetChildren()) do ch:Destroy() end
            for i,opt in ipairs(opts) do
                local isSel=(opt==cfg[key])
                local item=mkBtn(listFrame,opt,
                    isSel and Color3.fromRGB(28,28,36) or Color3.fromRGB(20,20,26),
                    UDim2.new(1,0,0,ITEM_H),UDim2.new(0,0,0,(i-1)*ITEM_H))
                item.TextSize=10; item.TextColor3=isSel and WHITE or DIM
                item.TextXAlignment=Enum.TextXAlignment.Left
                item.ZIndex=41
                local pad=Instance.new("UIPadding"); pad.PaddingLeft=UDim.new(0,10); pad.Parent=item
                if isSel then
                    local bar=mkFrame(item,cfg.accentColor,UDim2.new(0,2,1,0),UDim2.new(0,0,0,0))
                    bar.ZIndex=42
                end
                item.MouseButton1Click:Connect(function()
                    cfg[key]=opt; valBtn.Text=opt
                    if onChanged then onChanged(opt) end
                    listOpen=false; listFrame.Size=UDim2.new(1,-20,0,0)
                    refreshItems()
                end)
                item.MouseEnter:Connect(function()
                    if opt~=cfg[key] then item.BackgroundColor3=Color3.fromRGB(26,26,33) end
                end)
                item.MouseLeave:Connect(function()
                    if opt~=cfg[key] then item.BackgroundColor3=Color3.fromRGB(20,20,26) end
                end)
            end
        end
        valBtn.MouseButton1Click:Connect(function()
            listOpen=not listOpen
            listFrame.Size=UDim2.new(1,-20,0,listOpen and fullListH or 0)
            if listOpen then refreshItems() end
        end)
        y=y+rowH+1
    end
    local function btnRow(label,fn)
        local btn=mkBtn(scroll,label,Color3.fromRGB(22,22,28),UDim2.new(1,-20,0,22),UDim2.new(0,10,0,y),fn)
        btn.TextColor3=cfg.accentColor; btn.TextSize=11
        uiStroke(btn,Color3.fromRGB(35,35,45),1)
        y=y+26
    end
    if curTab=="visuals" then
        header("Enemy ESP")
        togRow("esp enabled",   "espOn",     nil)
        togRow("box esp",       "boxOn",     "boxColor")
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local enabled=cfg.boxOn
            local on=cfg.boxFillOn and enabled
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"box fill",UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),enabled and (on and WHITE or DIM) or Color3.fromRGB(50,50,58),11)
            if enabled then
                local sw=mkFrame(row,cfg.boxFillColor,UDim2.new(0,10,0,10),UDim2.new(1,-28,0.5,-5))
                uiCorner(sw,2); sw.ZIndex=4
                local swBtn=mkBtn(sw,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
                swBtn.BackgroundTransparency=1; swBtn.ZIndex=6
                local anchor=y+rowH+1
                swBtn.MouseButton1Click:Connect(function()
                    if pkKey=="boxFillColor" then pkKey=nil; picker.Visible=false
                    else
                        pkKey="boxFillColor"
                        local c=cfg.boxFillColor
                        pkH,pkS,pkV=rgb2hsv(math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
                        picker.Parent=scroll; picker.Position=UDim2.new(0,10,0,anchor)
                        picker.Visible=true; picker.ZIndex=50; pkRefresh()
                    end
                end)
            end
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            if enabled then
                local chkBtn=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
                chkBtn.BackgroundTransparency=1; chkBtn.ZIndex=5
                chkBtn.MouseButton1Click:Connect(function() cfg.boxFillOn=not cfg.boxFillOn; rebuild() end)
                local lblBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-28,1,0),UDim2.new(0,0,0,0))
                lblBtn.BackgroundTransparency=1; lblBtn.ZIndex=3
                lblBtn.MouseButton1Click:Connect(function() cfg.boxFillOn=not cfg.boxFillOn; rebuild() end)
            end
            y=y+rowH+1
        end
        togRow("health bar",    "healthOn",  nil)
        togRow("name text",     "nameOn",    "nameColor")
        togRow("distance text", "distOn",    "distColor")
        togRow("team check",    "teamCheck", nil)
        togRow("skeleton esp",  "skelOn",    "skelColor")
        sep()
        header("Third Person")
        local function tpRow()
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local function getVal()
                local ok,v=pcall(function() return workspace.ThirdPerson.Value end)
                return ok and v==true
            end
            local on=getVal()
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"third person",UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            local chkBtn=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            chkBtn.BackgroundTransparency=1; chkBtn.ZIndex=5
            chkBtn.MouseButton1Click:Connect(function()
                pcall(function() workspace.ThirdPerson.Value=not workspace.ThirdPerson.Value end)
                rebuild()
            end)
            local labelBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-20,1,0),UDim2.new(0,0,0,0))
            labelBtn.BackgroundTransparency=1; labelBtn.ZIndex=3
            labelBtn.MouseButton1Click:Connect(function()
                pcall(function() workspace.ThirdPerson.Value=not workspace.ThirdPerson.Value end)
                rebuild()
            end)
            y=y+rowH+1
        end
        tpRow()
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,"keybind",UDim2.new(0.5,0,1,0),UDim2.new(0,10,0,0),DIM,11)
            local waiting=false
            local keyLblTp=mkLabel(row,"["..cfg.tpKey.."]",UDim2.new(0.5,-10,1,0),UDim2.new(0.5,0,0,0),cfg.accentColor,11,Enum.TextXAlignment.Right)
            local bindBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            bindBtn.BackgroundTransparency=1; bindBtn.ZIndex=5
            bindBtn.MouseButton1Click:Connect(function()
                if waiting then return end
                waiting=true
                keyLblTp.Text="[press key]"
                keyLblTp.TextColor3=Color3.fromRGB(255,180,0)
                local conn
                conn=UserInputService.InputBegan:Connect(function(inp,gpe)
                    if inp.UserInputType~=Enum.UserInputType.Keyboard then return end
                    local name=inp.KeyCode.Name
                    cfg.tpKey=name
                    keyLblTp.Text="["..name.."]"
                    keyLblTp.TextColor3=cfg.accentColor
                    waiting=false
                    conn:Disconnect()
                    rebuildKbPanel()
                end)
            end)
            y=y+rowH+1
        end
    elseif curTab=="legitbot" then
        header("Aimbot")
        do
            local rowH=22
            local OPTS={"hold","toggle"}
            local ITEM_H=18
            local menuH=#OPTS*ITEM_H
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local on=cfg.aimOn
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"aimbot",UDim2.new(1,-150,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)
            local modeLbl=mkLabel(row,"["..cfg.aimMode.."]",UDim2.new(0,48,1,0),UDim2.new(1,-148,0,0),DIM,10,Enum.TextXAlignment.Left)
            local waiting=false
            local aimKeyLbl=mkLabel(row,"["..cfg.aimKey.."]",UDim2.new(0,90,1,0),UDim2.new(1,-100,0,0),cfg.accentColor,10,Enum.TextXAlignment.Left)
            aimKeyLbl.ZIndex=4
            local keyBindBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(0,90,1,0),UDim2.new(1,-100,0,0))
            keyBindBtn.BackgroundTransparency=1; keyBindBtn.ZIndex=5
            keyBindBtn.MouseButton1Click:Connect(function()
                if waiting then return end
                waiting=true
                aimKeyLbl.Text="[...]"
                aimKeyLbl.TextColor3=Color3.fromRGB(255,180,0)
                local conn
                conn=UserInputService.InputBegan:Connect(function(inp)
                    local name
                    if inp.UserInputType==Enum.UserInputType.MouseButton1 then name="MouseButton1"
                    elseif inp.UserInputType==Enum.UserInputType.MouseButton2 then name="MouseButton2"
                    elseif inp.UserInputType==Enum.UserInputType.Keyboard then name=inp.KeyCode.Name end
                    if not name then return end
                    cfg.aimKey=name; cfg.aimActive=false
                    aimKeyLbl.Text="["..name.."]"
                    aimKeyLbl.TextColor3=cfg.accentColor
                    waiting=false; conn:Disconnect()
                    rebuildKbPanel()
                end)
            end)
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            local chkBtn=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            chkBtn.BackgroundTransparency=1; chkBtn.ZIndex=5
            chkBtn.MouseButton1Click:Connect(function() cfg.aimOn=not cfg.aimOn; rebuild() end)
            local menu=mkFrame(scroll,Color3.fromRGB(18,18,22),UDim2.new(0,80,0,0),UDim2.new(1,-88,0,y+rowH))
            uiStroke(menu,BDR,1); menu.ClipsDescendants=true; menu.ZIndex=40
            local menuOpen=false
            local function refreshMenu()
                for _,c in ipairs(menu:GetChildren()) do c:Destroy() end
                for i,opt in ipairs(OPTS) do
                    local isSel=opt==cfg.aimMode
                    local item=mkBtn(menu,opt,isSel and Color3.fromRGB(28,28,36) or Color3.fromRGB(18,18,22),
                        UDim2.new(1,0,0,ITEM_H),UDim2.new(0,0,0,(i-1)*ITEM_H))
                    item.TextSize=10; item.TextColor3=isSel and WHITE or DIM; item.ZIndex=42
                    if isSel then mkFrame(item,cfg.accentColor,UDim2.new(0,2,1,0),UDim2.new(0,0,0,0)).ZIndex=43 end
                    item.MouseButton1Click:Connect(function()
                        cfg.aimMode=opt; cfg.aimActive=false
                        modeLbl.Text="["..opt.."]"
                        menuOpen=false; menu.Size=UDim2.new(0,80,0,0)
                        refreshMenu()
                    end)
                    item.MouseEnter:Connect(function() if not isSel then item.BackgroundColor3=Color3.fromRGB(26,26,33) end end)
                    item.MouseLeave:Connect(function() if not isSel then item.BackgroundColor3=Color3.fromRGB(18,18,22) end end)
                end
            end
            local labelBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-80,1,0),UDim2.new(0,0,0,0))
            labelBtn.BackgroundTransparency=1; labelBtn.ZIndex=3
            labelBtn.MouseButton1Click:Connect(function() cfg.aimOn=not cfg.aimOn; rebuild() end)
            labelBtn.MouseButton2Click:Connect(function()
                menuOpen=not menuOpen
                menu.Size=UDim2.new(0,80,0,menuOpen and menuH or 0)
                if menuOpen then refreshMenu() end
            end)
            y=y+rowH+1
        end
        togRow("visible only", "visOnly",  nil)
        togRow("team check",   "teamCheck",nil)
        sep()
        header("Settings")
        sldRow("smoothness",   "smoothness",1,15)
        sep()
        header("FOV")
        togRow("show fov",   "fovShow",   "fovColor")
        sldRow("fov radius", "fovRadius", 10,300)
        sep()
        header("Target")
        dropRow("target mode","targetPart",TARGET_OPTS)
        sep()
        header("Triggerbot")
        togRow("triggerbot",   "triggerOn",  nil)
        togRow("team check",   "teamCheck",  nil)
        sldRow("delay (ms)",   "triggerDelay", 10, 500)
    elseif curTab=="movement" then
        header("Movement")
        togRow("bhop","bhop",nil)
        togRow("better hop","betterHop",nil)
        togRow("speed graph","speedGraphOn",nil)
        sep()
        header("Fly")
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local on=cfg.flyEnabled
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"cframe fly",UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            local function toggle()
                cfg.flyEnabled=not cfg.flyEnabled
                cfg.flyOn=cfg.flyEnabled
                if cfg.flyOn then startFly() else stopFly() end
                rebuild()
            end
            local chkBtn=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            chkBtn.BackgroundTransparency=1; chkBtn.ZIndex=5
            chkBtn.MouseButton1Click:Connect(toggle)
            local lblBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-20,1,0),UDim2.new(0,0,0,0))
            lblBtn.BackgroundTransparency=1; lblBtn.ZIndex=3
            lblBtn.MouseButton1Click:Connect(toggle)
            y=y+rowH+1
        end
        sldRow("fly speed","flySpeed",10,200)
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,"fly keybind",UDim2.new(0.5,0,1,0),UDim2.new(0,10,0,0),DIM,11)
            local waiting=false
            local flyKeyLbl=mkLabel(row,"["..cfg.flyKey.."]",UDim2.new(0.5,-10,1,0),UDim2.new(0.5,0,0,0),cfg.accentColor,11,Enum.TextXAlignment.Right)
            local bindBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            bindBtn.BackgroundTransparency=1; bindBtn.ZIndex=5
            bindBtn.MouseButton1Click:Connect(function()
                if waiting then return end
                waiting=true
                flyKeyLbl.Text="[press key]"
                flyKeyLbl.TextColor3=Color3.fromRGB(255,180,0)
                local conn
                conn=UserInputService.InputBegan:Connect(function(inp,gpe)
                    if inp.UserInputType~=Enum.UserInputType.Keyboard then return end
                    local name=inp.KeyCode.Name
                    cfg.flyKey=name
                    flyKeyLbl.Text="["..name.."]"
                    flyKeyLbl.TextColor3=cfg.accentColor
                    waiting=false; conn:Disconnect()
                    rebuildKbPanel()
                end)
            end)
            y=y+rowH+1
        end
    elseif curTab=="misc" then
        header("Misc")
        togRow("watermark","wmOn",nil)
        togRow("keybind list","kbListOn",nil)
        sep()
        btnRow("Remove Fall Damage", function()
            pcall(function() game:GetService("ReplicatedStorage").Events.FallDamage:Destroy() end)
        end)
        sep()
        btnRow("Rejoin Server", function()
            local TS=game:GetService("TeleportService")
            pcall(function()
                local src=readfile("bankroll_esp.lua")
                queue_on_teleport("loadstring("..string.format("%q",src)..")()")
            end)
            TS:TeleportToPlaceInstance(game.PlaceId, game.JobId, lp)
        end)
        btnRow("Server Hop", function()
            local TS=game:GetService("TeleportService")
            local HS=game:GetService("HttpService")
            pcall(function()
                local src=readfile("bankroll_esp.lua")
                queue_on_teleport("loadstring("..string.format("%q",src)..")()")
            end)
            local ok,res=pcall(function()
                return HS:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Desc&limit=100"))
            end)
            if ok and res and res.data then
                for _,s in ipairs(res.data) do
                    if s.id~=game.JobId and s.playing<s.maxPlayers then
                        TS:TeleportToPlaceInstance(game.PlaceId,s.id,lp); return
                    end
                end
            end
            TS:Teleport(game.PlaceId,lp)
        end)
        btnRow("Panic Mode", function()
            cfg.espOn=false; cfg.aimOn=false; cfg.triggerOn=false
            cfg.bhop=false; cfg.betterHop=false; cfg.fovShow=false; cfg.wmOn=false; cfg.speedGraphOn=false; cfg.silentFovShow=false
            stopFly(); stopSpin()
            window.Visible=false; fovCircle.Visible=false
            wmLabel.Visible=false; wmBg.Visible=false; wmAccent.Visible=false
            sgBg.Visible=false; sgAccent.Visible=false; sgLabel.Visible=false; sgSpeedLbl.Visible=false
            for _,l in ipairs(sgLines) do l.Visible=false end
            for _,v in pairs(cache) do for _,d in pairs(v) do pcall(function() d.Visible=false end) end end
        end)
    elseif curTab=="world" then
        header("World Colors")
        togRow("enable world","worldOn",nil)
        sep()
        header("Colors")
        local function worldColorRow(label,key)
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,label,UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),DIM,11)
            local sw=mkFrame(row,cfg[key],UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(sw,2); sw.ZIndex=4
            local swBtn=mkBtn(sw,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            swBtn.BackgroundTransparency=1; swBtn.ZIndex=6
            local anchor=y+rowH+1
            swBtn.MouseButton1Click:Connect(function()
                if pkKey==key then pkKey=nil; picker.Visible=false
                else
                    pkKey=key
                    local c=cfg[key]
                    pkH,pkS,pkV=rgb2hsv(math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
                    picker.Parent=scroll
                    picker.Position=UDim2.new(0,10,0,anchor)
                    picker.Visible=true; picker.ZIndex=50; pkRefresh()
                end
            end)
            y=y+rowH+1
        end
        worldColorRow("sky color",     "skyColor")
        worldColorRow("ambient color", "ambientColor")
        sep()
        header("SmokeFlash")
        togRow("remove smoke","smokeOn",nil)
        togRow("remove flash","flashOn",nil)
        sep()
        header("Dropped Item ESP")
        togRow("item esp",    "itemEspOn",       "itemEspColor")
        togRow("show distance","itemEspShowDist", nil)
        sldRow("max distance","itemEspMaxDist", 10, 1000)
    elseif curTab=="semirage/rage" then
        header("Silent Aim")
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local on=getgenv().SilentAimSettings.Enabled
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"silent aim",UDim2.new(1,-150,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)
            local waiting=false
            local saKeyLbl=mkLabel(row,"["..cfg.silentKey.."]",UDim2.new(0,90,1,0),UDim2.new(1,-100,0,0),cfg.accentColor,10,Enum.TextXAlignment.Left)
            saKeyLbl.ZIndex=4
            local keyBindBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(0,90,1,0),UDim2.new(1,-100,0,0))
            keyBindBtn.BackgroundTransparency=1; keyBindBtn.ZIndex=5
            keyBindBtn.MouseButton1Click:Connect(function()
                if waiting then return end
                waiting=true
                saKeyLbl.Text="[...]"
                saKeyLbl.TextColor3=Color3.fromRGB(255,180,0)
                local conn
                conn=UserInputService.InputBegan:Connect(function(inp,gpe)
                    if inp.UserInputType~=Enum.UserInputType.Keyboard then return end
                    local name=inp.KeyCode.Name
                    cfg.silentKey=name
                    saKeyLbl.Text="["..name.."]"
                    saKeyLbl.TextColor3=cfg.accentColor
                    waiting=false; conn:Disconnect()
                    rebuildKbPanel()
                end)
            end)
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            local function toggleSA()
                getgenv().SilentAimSettings.Enabled=not getgenv().SilentAimSettings.Enabled
                rebuild()
                rebuildKbPanel()
            end
            local cb=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            cb.BackgroundTransparency=1; cb.ZIndex=5
            cb.MouseButton1Click:Connect(toggleSA)
            local lb=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-100,1,0),UDim2.new(0,0,0,0))
            lb.BackgroundTransparency=1; lb.ZIndex=3
            lb.MouseButton1Click:Connect(toggleSA)
            y=y+rowH+1
        end
        togRow("team check","teamCheck",nil)
        togRow("visible only","visOnly",nil)
        do
            local rowH=32
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,"hit chance",UDim2.new(0.7,0,0,14),UDim2.new(0,10,0,2),DIM,11)
            local vLbl=mkLabel(row,tostring(math.floor(getgenv().SilentAimSettings.HitChance)),UDim2.new(0.3,-10,0,14),UDim2.new(0.7,0,0,2),cfg.accentColor,11,Enum.TextXAlignment.Right)
            local trk=mkFrame(row,Color3.fromRGB(32,32,40),UDim2.new(1,-20,0,3),UDim2.new(0,10,0,20))
            uiCorner(trk,2)
            local pct=(getgenv().SilentAimSettings.HitChance-1)/99
            local fil=mkFrame(trk,cfg.accentColor,UDim2.new(pct,0,1,0),UDim2.new(0,0,0,0)); uiCorner(fil,2)
            local thb=mkFrame(trk,WHITE,UDim2.new(0,8,0,8),UDim2.new(pct,-4,0.5,-4)); uiCorner(thb,9)
            local sd=false
            local function upd(mx)
                local a=trk.AbsolutePosition; local s=trk.AbsoluteSize
                local p=math.clamp((mx-a.X)/s.X,0,1)
                getgenv().SilentAimSettings.HitChance=math.floor(1+99*p)
                fil.Size=UDim2.new(p,0,1,0); thb.Position=UDim2.new(p,-4,0.5,-4)
                vLbl.Text=tostring(getgenv().SilentAimSettings.HitChance)
            end
            trk.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=true; upd(i.Position.X) end end)
            UserInputService.InputChanged:Connect(function(i) if sd and i.UserInputType==Enum.UserInputType.MouseMovement then upd(i.Position.X) end end)
            UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=false end end)
            y=y+rowH+2
        end
        togRow("show fov","silentFovShow","silentFovColor")
        do
            local rowH=32
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,"fov radius",UDim2.new(0.7,0,0,14),UDim2.new(0,10,0,2),DIM,11)
            local vLbl=mkLabel(row,tostring(math.floor(getgenv().SilentAimSettings.FOVRadius)),UDim2.new(0.3,-10,0,14),UDim2.new(0.7,0,0,2),cfg.accentColor,11,Enum.TextXAlignment.Right)
            local trk=mkFrame(row,Color3.fromRGB(32,32,40),UDim2.new(1,-20,0,3),UDim2.new(0,10,0,20))
            uiCorner(trk,2)
            local pct=(getgenv().SilentAimSettings.FOVRadius-10)/990
            local fil=mkFrame(trk,cfg.accentColor,UDim2.new(pct,0,1,0),UDim2.new(0,0,0,0)); uiCorner(fil,2)
            local thb=mkFrame(trk,WHITE,UDim2.new(0,8,0,8),UDim2.new(pct,-4,0.5,-4)); uiCorner(thb,9)
            local sd=false
            local function upd(mx)
                local a=trk.AbsolutePosition; local s=trk.AbsoluteSize
                local p=math.clamp((mx-a.X)/s.X,0,1)
                getgenv().SilentAimSettings.FOVRadius=math.floor(10+990*p)
                fil.Size=UDim2.new(p,0,1,0); thb.Position=UDim2.new(p,-4,0.5,-4)
                vLbl.Text=tostring(getgenv().SilentAimSettings.FOVRadius)
            end
            trk.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=true; upd(i.Position.X) end end)
            UserInputService.InputChanged:Connect(function(i) if sd and i.UserInputType==Enum.UserInputType.MouseMovement then upd(i.Position.X) end end)
            UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then sd=false end end)
            y=y+rowH+2
        end
        dropRow("target part","targetPart",{"Head","HumanoidRootPart","UpperTorso","Torso","Random"})
        sep()
        togRow("auto fire","autoFireOn",nil)
        togRow("ignore fov","ignoreFov",nil)
        sep()
        header("Anti-Aim")
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            local on=cfg.antiAimOn
            if on then mkFrame(row,cfg.accentColor,UDim2.new(0,2,0,10),UDim2.new(0,0,0.5,-5)) end
            mkLabel(row,"jitter",UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),on and WHITE or DIM,11)
            local chk=mkFrame(row,on and Color3.fromRGB(30,80,180) or Color3.fromRGB(38,38,48),UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(chk,2); chk.ZIndex=3
            local function toggle()
                cfg.antiAimOn=not cfg.antiAimOn
                if cfg.antiAimOn then startSpin() else stopSpin() end
                rebuild()
            end
            local cb=mkBtn(chk,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            cb.BackgroundTransparency=1; cb.ZIndex=5
            cb.MouseButton1Click:Connect(toggle)
            local lb=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,-20,1,0),UDim2.new(0,0,0,0))
            lb.BackgroundTransparency=1; lb.ZIndex=3
            lb.MouseButton1Click:Connect(toggle)
            y=y+rowH+1
        end
        sldRow("spin speed","spinSpeed",10,30)
    elseif curTab=="config" then
        header("Profile")
        local iRow=mkFrame(scroll,ROW,UDim2.new(1,-8,0,30),UDim2.new(0,4,0,y))
        local nb=Instance.new("TextBox")
        nb.BackgroundColor3=BG; nb.BorderSizePixel=0
        nb.PlaceholderText="config name..."; nb.PlaceholderColor3=DIM
        nb.Text=""; nb.TextColor3=WHITE; nb.TextSize=11
        nb.Font=Enum.Font.GothamMedium
        nb.TextXAlignment=Enum.TextXAlignment.Left
        nb.ClearTextOnFocus=false
        nb.Size=UDim2.new(1,-70,0,20); nb.Position=UDim2.new(0,8,0.5,-10)
        uiStroke(nb,BDR,1); nb.Parent=iRow
        local sb=mkBtn(iRow,"save",BG2,UDim2.new(0,54,0,20),UDim2.new(1,-62,0.5,-10))
        sb.TextColor3=cfg.accentColor; sb.TextSize=11; uiStroke(sb,BDR,1)
        sb.MouseButton1Click:Connect(function() cfgSave(nb.Text) end)
        y=y+34
        local files=cfgList()
        if #files>0 then
            local selName=files[1]
            local rowH=24
            local ITEM_H=20
            local fullListH=#files*ITEM_H
            local row=mkFrame(scroll,ROW,UDim2.new(1,-8,0,rowH),UDim2.new(0,4,0,y))
            mkLabel(row,"profile",UDim2.new(0.5,0,1,0),UDim2.new(0,10,0,0),DIM,11)
            local valBtn=mkBtn(row,selName,BG2,UDim2.new(0,145,0,18),UDim2.new(1,-152,0.5,-9))
            valBtn.TextSize=10; uiStroke(valBtn,BDR,1)
            local chevLbl=mkLabel(valBtn,"v",UDim2.new(0,14,1,0),UDim2.new(1,-16,0,0),DIM,9,Enum.TextXAlignment.Left)
            local listY=y+rowH+2
            local spacer=mkFrame(scroll,BG,UDim2.new(1,-8,0,fullListH),UDim2.new(0,4,0,listY))
            spacer.BackgroundTransparency=1
            local listFrame=mkFrame(scroll,BG2,UDim2.new(1,-8,0,0),UDim2.new(0,4,0,listY))
            uiStroke(listFrame,BDR,1)
            listFrame.ClipsDescendants=true; listFrame.ZIndex=40
            local listOpen=false
            local function refreshItems()
                for _,ch in ipairs(listFrame:GetChildren()) do ch:Destroy() end
                for i,opt in ipairs(files) do
                    local isSel=(opt==selName)
                    local item=mkBtn(listFrame,opt,
                        isSel and Color3.fromRGB(30,30,38) or BG2,
                        UDim2.new(1,0,0,ITEM_H),UDim2.new(0,0,0,(i-1)*ITEM_H))
                    item.TextSize=10; item.TextColor3=isSel and WHITE or DIM; item.ZIndex=41
                    if isSel then mkFrame(item,cfg.accentColor,UDim2.new(0,2,1,0),UDim2.new(0,0,0,0)).ZIndex=42 end
                    local del=mkBtn(item,"x",Color3.new(0,0,0),UDim2.new(0,20,1,0),UDim2.new(1,-20,0,0))
                    del.BackgroundTransparency=1; del.TextColor3=Color3.fromRGB(180,60,60); del.TextSize=10; del.ZIndex=43
                    del.MouseButton1Click:Connect(function()
                        local path=CONFIG_DIR.."/"..opt..".txt"
                        local ok=false
                        if not ok then ok=pcall(function() deletefile(path) end) end
                        if not ok then ok=pcall(function() removeFile(path) end) end
                        if not ok then pcall(writefile,path,"") end
                        for j,f2 in ipairs(files) do
                            if f2==opt then table.remove(files,j); break end
                        end
                        if selName==opt then selName=#files>0 and files[1] or "" end
                        valBtn.Text=selName~="" and selName or "(none)"
                        listFrame.Size=UDim2.new(1,-8,0,#files*ITEM_H)
                        spacer.Size=UDim2.new(1,-8,0,#files*ITEM_H)
                        refreshItems()
                    end)
                    item.MouseButton1Click:Connect(function()
                        selName=opt; valBtn.Text=opt
                        listOpen=false; listFrame.Size=UDim2.new(1,-8,0,0); chevLbl.Text="v"
                        refreshItems()
                    end)
                    item.MouseEnter:Connect(function() if opt~=selName then item.BackgroundColor3=Color3.fromRGB(26,26,33) end end)
                    item.MouseLeave:Connect(function() if opt~=selName then item.BackgroundColor3=BG2 end end)
                end
            end
            valBtn.MouseButton1Click:Connect(function()
                listOpen=not listOpen
                listFrame.Size=UDim2.new(1,-8,0,listOpen and fullListH or 0)
                chevLbl.Text=listOpen and "^" or "v"
                if listOpen then refreshItems() end
            end)
            y=y+rowH+2+fullListH
            btnRow("load selected",function() cfgLoad(selName); rebuild() end)
        else
            mkLabel(scroll,"no configs saved",UDim2.new(1,0,0,16),UDim2.new(0,0,0,y),DIM,11,Enum.TextXAlignment.Center)
            y=y+22
        end
        btnRow("refresh",function() rebuild() end)
        sep()
        header("UI Appearance")
        local function cfgColorRow(label,key)
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,label,UDim2.new(1,-30,1,0),UDim2.new(0,10,0,0),DIM,11)
            local sw=mkFrame(row,cfg[key],UDim2.new(0,10,0,10),UDim2.new(1,-14,0.5,-5))
            uiCorner(sw,2)
            local swBtn=mkBtn(sw,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            swBtn.BackgroundTransparency=1
            local anchor=y+rowH+1
            swBtn.MouseButton1Click:Connect(function()
                if pkKey==key then pkKey=nil; picker.Visible=false
                else
                    pkKey=key
                    local c=cfg[key]
                    pkH,pkS,pkV=rgb2hsv(math.floor(c.R*255),math.floor(c.G*255),math.floor(c.B*255))
                    picker.Parent=scroll
                    picker.Position=UDim2.new(0,10,0,anchor)
                    picker.Visible=true; picker.ZIndex=50; pkRefresh()
                end
            end)
            y=y+rowH+1
        end
        cfgColorRow("accent color",  "accentColor")
        cfgColorRow("menu outline",  "outlineColor")
        sep()
        header("Keybind")
        do
            local rowH=22
            local row=mkFrame(scroll,BG,UDim2.new(1,0,0,rowH),UDim2.new(0,0,0,y))
            row.BackgroundTransparency=1
            mkLabel(row,"menu toggle",UDim2.new(0.5,0,1,0),UDim2.new(0,10,0,0),DIM,11)
            local waiting=false
            local bindLbl=mkLabel(row,"["..cfg.toggleKey.."]",UDim2.new(0.5,-10,1,0),UDim2.new(0.5,0,0,0),cfg.accentColor,11,Enum.TextXAlignment.Right)
            local bindBtn=mkBtn(row,"",Color3.new(0,0,0),UDim2.new(1,0,1,0),UDim2.new(0,0,0,0))
            bindBtn.BackgroundTransparency=1; bindBtn.ZIndex=5
            bindBtn.MouseButton1Click:Connect(function()
                if waiting then return end
                waiting=true
                bindLbl.Text="[press key]"
                bindLbl.TextColor3=Color3.fromRGB(255,180,0)
                local conn
                conn=UserInputService.InputBegan:Connect(function(inp,gpe)
                    if inp.UserInputType~=Enum.UserInputType.Keyboard then return end
                    local name=inp.KeyCode.Name
                    cfg.toggleKey=name
                    bindLbl.Text="["..name.."]"
                    bindLbl.TextColor3=cfg.accentColor
                    keyLbl.Text="["..name.."]"
                    waiting=false
                    conn:Disconnect()
                    rebuildKbPanel()
                end)
            end)
            y=y+rowH+1
        end
    end
    y=y+10
    scroll.CanvasSize=UDim2.new(0,0,0,y)
    rebuildKbPanel()
end
local tw=math.floor(WIN_W/#MAIN_TABS)
for i,t in ipairs(MAIN_TABS) do
    local btn=mkBtn(tabBar,t,BG,UDim2.new(0,tw,1,0),UDim2.new(0,(i-1)*tw,0,0))
    btn.TextSize=10; btn.TextColor3=DIM; btn.Font=Enum.Font.GothamMedium
    tabBtns[t]=btn
    btn.MouseButton1Click:Connect(function() curTab=t; rebuild() end)
    if i<#MAIN_TABS then mkFrame(tabBar,BDR,UDim2.new(0,1,1,0),UDim2.new(0,i*tw,0,0)) end
end
local tw2=math.floor(WIN_W/#TOP_TABS)
for i,t in ipairs(TOP_TABS) do
    local btn=mkBtn(topBar,t,Color3.fromRGB(11,11,14),UDim2.new(0,tw2,1,0),UDim2.new(0,(i-1)*tw2,0,0))
    btn.TextSize=10; btn.TextColor3=DIM; btn.Font=Enum.Font.GothamMedium
    topBtns[t]=btn
    btn.MouseButton1Click:Connect(function() curTab=t; rebuild() end)
    if i<#TOP_TABS then mkFrame(topBar,BDR,UDim2.new(0,1,1,0),UDim2.new(0,i*tw2,0,0)) end
end
UserInputService.InputBegan:Connect(function(inp,gpe)
    if gpe then return end
    local ok,kc=pcall(function() return Enum.KeyCode[cfg.toggleKey] end)
    if ok and inp.KeyCode==kc then window.Visible=not window.Visible end
    local ok2,kc2=pcall(function() return Enum.KeyCode[cfg.tpKey] end)
    if ok2 and inp.KeyCode==kc2 then
        local ok,v=pcall(function() return workspace.ThirdPerson end)
        if ok and v then
            pcall(function() workspace.ThirdPerson.Value=not workspace.ThirdPerson.Value end)
        end
    end
    local ok3,kc3=pcall(function() return Enum.KeyCode[cfg.flyKey] end)
    if ok3 and inp.KeyCode==kc3 and cfg.flyEnabled then
        cfg.flyOn=not cfg.flyOn
        if cfg.flyOn then startFly() else stopFly() end
    end
    local okSA,kcSA=pcall(function() return Enum.KeyCode[cfg.silentKey] end)
    if okSA and cfg.silentKey~="none" and inp.KeyCode==kcSA then
        getgenv().SilentAimSettings.Enabled=not getgenv().SilentAimSettings.Enabled
        rebuildKbPanel()
    end
    if cfg.aimOn and cfg.aimMode=="toggle" then
        local match=false
        if cfg.aimKey=="MouseButton1" and inp.UserInputType==Enum.UserInputType.MouseButton1 then match=true end
        if cfg.aimKey=="MouseButton2" and inp.UserInputType==Enum.UserInputType.MouseButton2 then match=true end
        if not match then
            local ok3,kc3=pcall(function() return Enum.KeyCode[cfg.aimKey] end)
            if ok3 and inp.KeyCode==kc3 then match=true end
        end
        if match then cfg.aimActive=not cfg.aimActive end
    end
end)
RunService.Heartbeat:Connect(function(dt)
    if cfg.wmOn then
        local fps=math.floor(1/game:GetService("Stats").HeartbeatTimeMs*1000)
        local t=os.date("*t")
        local timeStr=string.format("%02d:%02d:%02d",t.hour,t.min,t.sec)
        wmLabel.Text="Bankroll  |  "..lp.Name.."  |  "..fps.." fps  |  "..timeStr
        local tw=wmLabel.TextBounds.X
        local bw=tw+12; local bh=22
        wmBg.Size=Vector2.new(bw,bh); wmBg.Visible=true
        wmAccent.Size=Vector2.new(bw,2); wmAccent.Color=cfg.accentColor; wmAccent.Visible=true
        wmLabel.Visible=true
        kbTopLine.BackgroundColor3=cfg.accentColor
        SG_Y=6+bh+4
    else
        wmLabel.Visible=false; wmBg.Visible=false; wmAccent.Visible=false
        SG_Y=6
    end

    if cfg.speedGraphOn then
        local chr=lp.Character
        local hrp=chr and chr:FindFirstChild("HumanoidRootPart")
        local spd=0
        if hrp then
            local v=hrp.AssemblyLinearVelocity
            spd=math.floor(Vector3.new(v.X,0,v.Z).Magnitude)
        end
        table.remove(sgHistory,1); table.insert(sgHistory,spd)
        local maxSpd=math.max(SG_MAX,table.unpack(sgHistory))
        local vp=cam.ViewportSize
        local cx=math.floor(vp.X/2); local cy=math.floor(vp.Y*0.62)
        local gx=cx-SG_W/2
        sgBg.Visible=false; sgAccent.Visible=false; sgLabel.Visible=false
        sgSpeedLbl.Text=spd.." u/s"; sgSpeedLbl.Color=cfg.accentColor
        sgSpeedLbl.Center=true
        sgSpeedLbl.Position=Vector2.new(cx, cy+SG_H+4); sgSpeedLbl.Visible=true
        for i=1,SG_W-1 do
            local x1=gx+i-1; local x2=gx+i
            local y1=cy+SG_H-(sgHistory[i]/maxSpd)*SG_H
            local y2=cy+SG_H-(sgHistory[i+1]/maxSpd)*SG_H
            sgLines[i].From=Vector2.new(x1,y1); sgLines[i].To=Vector2.new(x2,y2)
            sgLines[i].Color=cfg.accentColor; sgLines[i].Visible=true
        end
    else
        sgBg.Visible=false; sgAccent.Visible=false; sgLabel.Visible=false; sgSpeedLbl.Visible=false
        for _,l in ipairs(sgLines) do l.Visible=false end
    end
    if cfg.worldOn then
        local lg=game:GetService("Lighting")
        local sky=lg:FindFirstChildOfClass("Sky")
        if sky then sky:Destroy() end
        lg.Ambient=cfg.ambientColor
        lg.OutdoorAmbient=cfg.skyColor
        lg.ColorShift_Top=cfg.skyColor
        lg.ColorShift_Bottom=cfg.ambientColor
        lg.FogEnd=100000
        lg.FogColor=cfg.skyColor
    end
    if cfg.smokeOn then
        pcall(function() workspace.Ray_Ignore.Smokes:Destroy() end)
    end
    if cfg.flashOn then
        pcall(function() game:GetService("ReplicatedStorage").Events.Flash:Destroy() end)
    end
    if pkKey=="accentColor" then
        topLine.BackgroundColor3=cfg.accentColor
        local b=tabBtns[curTab] or topBtns[curTab]; if b then
            local ul=b:FindFirstChild("UL"); if ul then ul.BackgroundColor3=cfg.accentColor end
        end
    elseif pkKey=="outlineColor" then
        winStroke.Color=cfg.outlineColor
    end
end)
rebuild()

설명

free keyles open sourece hvh cheat PLS NO USE AUTO FIRE DTC AND BANNBLE ME NO RESOLBOBLLE

댓글 (0)

대화에 참여하려면 로그인하세요

  • 첫 댓글을 작성하세요.

자주 묻는 질문

Hvh Cheat open source 스크립트는 어떻게 사용하나요?
위의 스크립트 코드를 복사하고, Roblox 엑시큐터를 열어 붙여넣은 후, 게임 중에 실행을 누르세요. 스크립트가 실행되면 기능이 즉시 활성화됩니다.
Hvh Cheat open source 스크립트는 무료인가요?
네. 이 스크립트는 무료로 복사하고 사용할 수 있습니다. 키 시스템을 사용하는 경우, 링크를 통해 무료로 키를 받으세요.
Hvh Cheat open source 스크립트는 안전한가요?
전체 소스 코드가 이 페이지에 표시되어 실행 전에 정확히 무엇을 하는지 확인할 수 있습니다. 항상 신뢰할 수 있는 엑시큐터를 사용하고, 스크립트 사용은 Roblox 이용 약관에 위반되므로 자의적 위험으로 사용하세요.
Hvh Cheat open source에 호환되는 엑시큐터는?
이 스크립트는 대부분의 인기 Roblox 엑시큐터에서 작동합니다. 기기에 맞는 신뢰할 수 있는 무료 또는 유료 엑시큐터를 찾으려면 엑시큐터 페이지를 확인하세요.
Hvh Cheat open source | BloxScripter