Description

This script is made by KAaMs hub and you can use it in most of the roblox game easily and its working with xeno.

Features

  • + god mode
  • + Visuals
  • + Fling
  • + Fun
  • + Cosmetics
  • + fly
  • + teleport
  • + noclip
  • + aimbot
  • + rainbow avatar
  • + invisible
  • + rainbow trail
  • + fling players
  • + infinite jump
  • + esp
  • + ect.

Script

Add Xeno Scripts as a preferred source
-- ============================================================
--  kAaMs Hub  |  LocalScript → StarterPlayerScripts
--  Requires FlingHandler Script in ServerScriptService
-- ============================================================

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

local ME = Players.LocalPlayer
local function getChar() return ME.Character end
local function getHRP()  local c=getChar(); return c and c:FindFirstChild("HumanoidRootPart") end
local function getHum()  local c=getChar(); return c and c:FindFirstChildOfClass("Humanoid") end

local FlingRE = ReplicatedStorage:WaitForChild("kAaMsFling", 10)

-- ── Palette ───────────────────────────────────────────────────────────
local C = {
    bg       = Color3.fromRGB(22,22,32),   sidebar  = Color3.fromRGB(15,15,22),
    card     = Color3.fromRGB(30,30,44),   border   = Color3.fromRGB(48,48,68),
    accent   = Color3.fromRGB(99,102,241), green    = Color3.fromRGB(34,197,94),
    orange   = Color3.fromRGB(234,88,12),  red      = Color3.fromRGB(210,50,50),
    yellow   = Color3.fromRGB(234,179,8),  text     = Color3.fromRGB(220,220,232),
    sub      = Color3.fromRGB(130,130,155),pill_off = Color3.fromRGB(50,50,72),
    row      = Color3.fromRGB(26,26,38),   row_sel  = Color3.fromRGB(40,38,72),
    teal     = Color3.fromRGB(20,184,166), pink     = Color3.fromRGB(236,72,153),
    purple   = Color3.fromRGB(168,85,247),
}

local TW = TweenInfo.new(0.14, Enum.EasingStyle.Quad)

local function mkCorner(p,r) local o=Instance.new("UICorner"); o.CornerRadius=UDim.new(0,r or 8); o.Parent=p end
local function mkStroke(p,col,th) local o=Instance.new("UIStroke"); o.Color=col or C.border; o.Thickness=th or 1; o.Parent=p end
local function mkFrame(p,props) local f=Instance.new("Frame"); f.BorderSizePixel=0; for k,v in pairs(props) do f[k]=v end; f.Parent=p; return f end
local function mkLabel(p,props) local l=Instance.new("TextLabel"); l.BackgroundTransparency=1; l.TextXAlignment=Enum.TextXAlignment.Left; l.Font=Enum.Font.GothamBold; for k,v in pairs(props) do l[k]=v end; l.Parent=p; return l end
local function mkBtn(p,props) local b=Instance.new("TextButton"); b.BorderSizePixel=0; b.Font=Enum.Font.GothamBold; for k,v in pairs(props) do b[k]=v end; b.Parent=p; return b end

local old=ME.PlayerGui:FindFirstChild("kAaMsHub"); if old then old:Destroy() end

-- ══════════════════════════════════════════════════════════════════════
--  WINDOW
-- ══════════════════════════════════════════════════════════════════════
local SG=Instance.new("ScreenGui"); SG.Name="kAaMsHub"; SG.ResetOnSpawn=false
SG.ZIndexBehavior=Enum.ZIndexBehavior.Sibling; SG.Parent=ME.PlayerGui

local WIN=mkFrame(SG,{Size=UDim2.new(0,580,0,460),Position=UDim2.new(0.5,-290,0.5,-230),
    BackgroundColor3=C.bg,Active=true,Draggable=true})
mkCorner(WIN,14); mkStroke(WIN,C.border,1.2)

local SB=mkFrame(WIN,{Size=UDim2.new(0,148,1,0),BackgroundColor3=C.sidebar})
mkCorner(SB,14)
mkFrame(SB,{Size=UDim2.new(0,14,1,0),Position=UDim2.new(1,-14,0,0),BackgroundColor3=C.sidebar})
mkLabel(SB,{Size=UDim2.new(1,0,0,30),Position=UDim2.new(0,0,0,12),Text="⚡",TextSize=24,TextColor3=C.accent,TextXAlignment=Enum.TextXAlignment.Center})
mkLabel(SB,{Size=UDim2.new(1,0,0,16),Position=UDim2.new(0,0,0,44),Text="kAaMs hub",TextSize=12,TextColor3=C.text,TextXAlignment=Enum.TextXAlignment.Center})
mkFrame(SB,{Size=UDim2.new(1,-20,0,1),Position=UDim2.new(0,10,0,68),BackgroundColor3=C.border})

local TAB_LIST=mkFrame(SB,{Size=UDim2.new(1,0,1,-80),Position=UDim2.new(0,0,0,76),BackgroundTransparency=1})
do
    local ul=Instance.new("UIListLayout"); ul.SortOrder=Enum.SortOrder.LayoutOrder; ul.Padding=UDim.new(0,4); ul.Parent=TAB_LIST
    local up=Instance.new("UIPadding"); up.PaddingLeft=UDim.new(0,8); up.PaddingRight=UDim.new(0,8); up.PaddingTop=UDim.new(0,4); up.Parent=TAB_LIST
end
mkLabel(SB,{Size=UDim2.new(1,0,0,18),Position=UDim2.new(0,0,1,-22),Text="[ 5 ]  Toggle",TextSize=10,TextColor3=C.sub,TextXAlignment=Enum.TextXAlignment.Center})

local CONTENT=mkFrame(WIN,{Size=UDim2.new(1,-156,1,-8),Position=UDim2.new(0,152,0,4),BackgroundTransparency=1})
local PAGE_TITLE=mkLabel(CONTENT,{Size=UDim2.new(1,-44,0,44),Text="Movement",TextSize=16,TextColor3=C.text})
local CLOSE=mkBtn(CONTENT,{Size=UDim2.new(0,26,0,26),Position=UDim2.new(1,-30,0,9),BackgroundColor3=C.red,Text="✕",TextColor3=C.text,TextSize=12})
mkCorner(CLOSE,6); CLOSE.MouseButton1Click:Connect(function() WIN.Visible=false end)

local SCROLL=Instance.new("ScrollingFrame")
SCROLL.Size=UDim2.new(1,0,1,-48); SCROLL.Position=UDim2.new(0,0,0,48)
SCROLL.BackgroundTransparency=1; SCROLL.BorderSizePixel=0
SCROLL.ScrollBarThickness=3; SCROLL.ScrollBarImageColor3=C.accent
SCROLL.CanvasSize=UDim2.new(0,0,0,0); SCROLL.AutomaticCanvasSize=Enum.AutomaticSize.Y
SCROLL.Parent=CONTENT
do
    local ul=Instance.new("UIListLayout"); ul.SortOrder=Enum.SortOrder.LayoutOrder; ul.Padding=UDim.new(0,8); ul.Parent=SCROLL
    local up=Instance.new("UIPadding"); up.PaddingLeft=UDim.new(0,4); up.PaddingRight=UDim.new(0,10); up.PaddingTop=UDim.new(0,4); up.Parent=SCROLL
end

-- ══════════════════════════════════════════════════════════════════════
--  TAB SYSTEM
-- ══════════════════════════════════════════════════════════════════════
local tabData={}; local tabCount=0
local function makeTab(icon,name)
    tabCount+=1; local order=tabCount
    local btn=mkBtn(TAB_LIST,{Size=UDim2.new(1,0,0,34),BackgroundColor3=C.sidebar,Text="",LayoutOrder=order}); mkCorner(btn,8)
    local ic=mkLabel(btn,{Size=UDim2.new(0,22,1,0),Position=UDim2.new(0,8,0,0),Text=icon,TextSize=13,TextColor3=C.sub,TextXAlignment=Enum.TextXAlignment.Center})
    local lb=mkLabel(btn,{Size=UDim2.new(1,-34,1,0),Position=UDim2.new(0,32,0,0),Text=name,TextSize=11,TextColor3=C.sub})
    local bar=mkFrame(btn,{Size=UDim2.new(0,3,0.6,0),Position=UDim2.new(0,0,0.2,0),BackgroundColor3=C.accent,Visible=false}); mkCorner(bar,2)
    local page=mkFrame(SCROLL,{Name=name.."Page",Size=UDim2.new(1,0,0,0),AutomaticSize=Enum.AutomaticSize.Y,BackgroundTransparency=1,Visible=false,LayoutOrder=order})
    do local ul=Instance.new("UIListLayout"); ul.SortOrder=Enum.SortOrder.LayoutOrder; ul.Padding=UDim.new(0,8); ul.Parent=page end
    tabData[name]={btn=btn,ic=ic,lb=lb,bar=bar,page=page}
    local function activate()
        for _,d in pairs(tabData) do d.page.Visible=false; d.bar.Visible=false; d.btn.BackgroundColor3=C.sidebar; d.ic.TextColor3=C.sub; d.lb.TextColor3=C.sub end
        page.Visible=true; bar.Visible=true; btn.BackgroundColor3=Color3.fromRGB(28,28,42)
        ic.TextColor3=C.accent; lb.TextColor3=C.text; PAGE_TITLE.Text=name; SCROLL.CanvasPosition=Vector2.zero
    end
    btn.MouseButton1Click:Connect(activate)
    if order==1 then activate() end
    return page
end

-- ══════════════════════════════════════════════════════════════════════
--  ELEMENT FACTORIES
-- ══════════════════════════════════════════════════════════════════════
local elemOrd=0
local function card(page,h)
    elemOrd+=1
    local f=mkFrame(page,{Size=UDim2.new(1,0,0,h),BackgroundColor3=C.card,LayoutOrder=elemOrd})
    mkCorner(f,10); mkStroke(f,C.border); return f
end

local function makeToggle(page,name,sub,cb)
    local f=card(page,56)
    mkLabel(f,{Size=UDim2.new(1,-70,0,20),Position=UDim2.new(0,14,0,10),Text=name,TextSize=13,TextColor3=C.text})
    mkLabel(f,{Size=UDim2.new(1,-70,0,16),Position=UDim2.new(0,14,0,30),Text=sub,TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub})
    local pill=mkBtn(f,{Size=UDim2.new(0,44,0,24),Position=UDim2.new(1,-58,0.5,-12),BackgroundColor3=C.pill_off,Text=""}); mkCorner(pill,12)
    local knob=mkFrame(pill,{Size=UDim2.new(0,18,0,18),Position=UDim2.new(0,3,0.5,-9),BackgroundColor3=Color3.new(1,1,1)}); mkCorner(knob,9)
    local on=false
    pill.MouseButton1Click:Connect(function()
        on=not on
        TweenService:Create(pill,TW,{BackgroundColor3=on and C.accent or C.pill_off}):Play()
        TweenService:Create(knob,TW,{Position=on and UDim2.new(1,-21,0.5,-9) or UDim2.new(0,3,0.5,-9)}):Play()
        cb(on)
    end)
end

local function makeSlider(page,name,mn,mx,def,cb)
    local f=card(page,64)
    mkLabel(f,{Size=UDim2.new(1,-70,0,18),Position=UDim2.new(0,14,0,10),Text=name,TextSize=13,TextColor3=C.text})
    local vl=mkLabel(f,{Size=UDim2.new(0,52,0,18),Position=UDim2.new(1,-62,0,10),Text=tostring(def),TextSize=13,TextColor3=C.accent,TextXAlignment=Enum.TextXAlignment.Right})
    local track=mkFrame(f,{Size=UDim2.new(1,-28,0,6),Position=UDim2.new(0,14,0,42),BackgroundColor3=C.pill_off}); mkCorner(track,3)
    local fill=mkFrame(track,{Size=UDim2.new((def-mn)/(mx-mn),0,1,0),BackgroundColor3=C.accent}); mkCorner(fill,3)
    local sk=mkBtn(track,{Size=UDim2.new(0,16,0,16),AnchorPoint=Vector2.new(0.5,0.5),Position=UDim2.new((def-mn)/(mx-mn),0,0.5,0),BackgroundColor3=Color3.new(1,1,1),Text="",ZIndex=5}); mkCorner(sk,8)
    local drag=false
    sk.MouseButton1Down:Connect(function() drag=true end)
    UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=false end end)
    UserInputService.InputChanged:Connect(function(i)
        if not drag or i.UserInputType~=Enum.UserInputType.MouseMovement then return end
        local r=math.clamp((i.Position.X-track.AbsolutePosition.X)/track.AbsoluteSize.X,0,1)
        local v=math.floor(mn+r*(mx-mn)); fill.Size=UDim2.new(r,0,1,0); sk.Position=UDim2.new(r,0,0.5,0); vl.Text=tostring(v); cb(v)
    end)
end

local function makeButton(page,label,color,cb)
    local f=card(page,48); mkStroke(f,color,1)
    local b=mkBtn(f,{Size=UDim2.new(1,-20,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=color,Text=label,TextColor3=Color3.new(1,1,1),TextSize=13}); mkCorner(b,8)
    b.MouseButton1Click:Connect(function()
        cb()
        TweenService:Create(b,TW,{BackgroundColor3=C.green}):Play()
        task.delay(0.4,function() TweenService:Create(b,TW,{BackgroundColor3=color}):Play() end)
    end)
    return b
end

local function makePlayerList(parent,height,onSelect)
    local stCard=card(parent,34)
    local stLbl=mkLabel(stCard,{Size=UDim2.new(1,-18,1,0),Position=UDim2.new(0,10,0,0),Text="👆  Select a player below",TextSize=11,TextColor3=C.sub})
    local lhCard=card(parent,34)
    mkLabel(lhCard,{Size=UDim2.new(1,-72,1,0),Position=UDim2.new(0,12,0,0),Text="🎮  Players in Lobby",TextSize=12,TextColor3=C.text})
    local refBtn=mkBtn(lhCard,{Size=UDim2.new(0,60,0,22),Position=UDim2.new(1,-64,0.5,-11),BackgroundColor3=C.accent,Text="↺  Refresh",TextColor3=C.text,TextSize=10}); mkCorner(refBtn,6)
    elemOrd+=1
    local outer=mkFrame(parent,{Size=UDim2.new(1,0,0,height),BackgroundColor3=Color3.fromRGB(18,18,28),LayoutOrder=elemOrd,ClipsDescendants=true})
    mkCorner(outer,10); mkStroke(outer,C.border)
    local sf=Instance.new("ScrollingFrame"); sf.Size=UDim2.new(1,0,1,0); sf.BackgroundTransparency=1; sf.BorderSizePixel=0
    sf.ScrollBarThickness=5; sf.ScrollBarImageColor3=C.accent; sf.CanvasSize=UDim2.new(0,0,0,0)
    sf.AutomaticCanvasSize=Enum.AutomaticSize.Y; sf.ScrollingDirection=Enum.ScrollingDirection.Y; sf.Parent=outer
    do
        local ul=Instance.new("UIListLayout"); ul.SortOrder=Enum.SortOrder.LayoutOrder; ul.Padding=UDim.new(0,4); ul.Parent=sf
        local up=Instance.new("UIPadding"); up.PaddingLeft=UDim.new(0,6); up.PaddingRight=UDim.new(0,10); up.PaddingTop=UDim.new(0,6); up.PaddingBottom=UDim.new(0,6); up.Parent=sf
    end
    local pBtns={}; local selected=nil
    local function setStatus(txt,col) stLbl.Text=txt; stLbl.TextColor3=col or C.sub end
    local function buildList()
        for _,c in ipairs(sf:GetChildren()) do if not c:IsA("UIListLayout") and not c:IsA("UIPadding") then c:Destroy() end end
        pBtns={}; selected=nil; setStatus("👆  Select a player below",C.sub)
        local others={}; for _,p in ipairs(Players:GetPlayers()) do if p~=ME then table.insert(others,p) end end
        if #others==0 then
            local ef=mkFrame(sf,{Size=UDim2.new(1,0,0,50),BackgroundColor3=Color3.fromRGB(24,24,36)}); mkCorner(ef,8)
            mkLabel(ef,{Size=UDim2.new(1,0,1,0),Text="😔  No other players in server",TextSize=12,Font=Enum.Font.Gotham,TextColor3=C.sub,TextXAlignment=Enum.TextXAlignment.Center}); return
        end
        for i,p in ipairs(others) do
            local row=mkFrame(sf,{Size=UDim2.new(1,0,0,44),BackgroundColor3=C.row,LayoutOrder=i}); mkCorner(row,8)
            local av=mkFrame(row,{Size=UDim2.new(0,30,0,30),Position=UDim2.new(0,7,0.5,-15),BackgroundColor3=C.accent}); mkCorner(av,15)
            mkLabel(av,{Size=UDim2.new(1,0,1,0),Text=string.upper(string.sub(p.Name,1,1)),TextSize=14,TextColor3=Color3.new(1,1,1),TextXAlignment=Enum.TextXAlignment.Center})
            mkLabel(row,{Size=UDim2.new(1,-110,0,18),Position=UDim2.new(0,45,0,5),Text=p.Name,TextSize=12,TextColor3=C.text})
            mkLabel(row,{Size=UDim2.new(1,-110,0,14),Position=UDim2.new(0,45,0,24),Text=(p.DisplayName~=p.Name) and p.DisplayName or "Roblox Player",TextSize=10,Font=Enum.Font.Gotham,TextColor3=C.sub})
            local sb=mkBtn(row,{Size=UDim2.new(0,54,0,26),Position=UDim2.new(1,-58,0.5,-13),BackgroundColor3=Color3.fromRGB(38,38,58),Text="Select",TextColor3=C.text,TextSize=11}); mkCorner(sb,6)
            pBtns[p]={row=row,btn=sb,av=av}
            sb.MouseButton1Click:Connect(function()
                for _,d in pairs(pBtns) do d.row.BackgroundColor3=C.row; d.btn.BackgroundColor3=Color3.fromRGB(38,38,58); d.btn.Text="Select"; d.btn.TextColor3=C.text; d.av.BackgroundColor3=C.accent end
                selected=p; row.BackgroundColor3=C.row_sel; sb.BackgroundColor3=C.accent; sb.Text="✓"; sb.TextColor3=Color3.new(1,1,1); av.BackgroundColor3=C.orange
                onSelect(p,setStatus)
            end)
        end
        TweenService:Create(refBtn,TW,{BackgroundColor3=C.green}):Play()
        task.delay(0.4,function() TweenService:Create(refBtn,TW,{BackgroundColor3=C.accent}):Play() end)
    end
    refBtn.MouseButton1Click:Connect(buildList)
    Players.PlayerAdded:Connect(function() task.wait(0.6); buildList() end)
    Players.PlayerRemoving:Connect(function() task.wait(0.15); buildList() end)
    buildList()
    return sf,buildList,setStatus,function() return selected end
end

-- ══════════════════════════════════════════════════════════════════════
--  FEATURE STATE
-- ══════════════════════════════════════════════════════════════════════
local fly=false; local flySpeed=50; local bv,bg2
local nc=false; local infJump=false; local god=false
local espOn=false; local espHL={}
local flingPow=150
local floatOn=false; local floatBV=nil
local spinOn=false; local spinConn=nil
local rainbowOn=false; local rainbowConn=nil
local trailOn=false; local trailObj=nil
local invisOn=false
local followOn=false; local followTarget=nil; local followConn=nil
local spectateOn=false; local spectateTarget=nil
local origCamType=nil

-- ── AIM ASSIST STATE ─────────────────────────────────────────────────
local aimOn          = false
local aimFOV         = 25    -- degrees (acquisition cone)
local aimSmooth      = 8     -- 1-20, divide by 100 for lerp factor
local aimDist        = 150   -- studs
local aimHead        = true  -- aim at head vs body center
local aimHoldOnly    = true  -- only active while right-click held
local aimLockedTarget = nil  -- currently locked part

-- ── FLY ───────────────────────────────────────────────────────────────
local function startFly()
    local hrp=getHRP(); local hum=getHum(); if not hrp or not hum then return end
    fly=true; hum.PlatformStand=true
    if hrp:FindFirstChild("_bv") then hrp:FindFirstChild("_bv"):Destroy() end
    if hrp:FindFirstChild("_bg") then hrp:FindFirstChild("_bg"):Destroy() end
    bv=Instance.new("BodyVelocity"); bv.Name="_bv"; bv.MaxForce=Vector3.new(1e5,1e5,1e5); bv.Velocity=Vector3.zero; bv.Parent=hrp
    bg2=Instance.new("BodyGyro"); bg2.Name="_bg"; bg2.MaxTorque=Vector3.new(1e5,1e5,1e5); bg2.P=1e4; bg2.Parent=hrp
end
local function stopFly()
    fly=false; local hum=getHum(); if hum then hum.PlatformStand=false end
    if bv and bv.Parent then bv:Destroy() end; if bg2 and bg2.Parent then bg2:Destroy() end; bv=nil; bg2=nil
end

-- ── ESP ───────────────────────────────────────────────────────────────
local function addESP(p)
    if p==ME then return end; local ch=p.Character; if not ch or espHL[p] then return end
    local h=Instance.new("Highlight"); h.FillColor=C.accent; h.OutlineColor=Color3.new(1,1,1)
    h.FillTransparency=0.35; h.OutlineTransparency=0; h.DepthMode=Enum.HighlightDepthMode.AlwaysOnTop; h.Adornee=ch; h.Parent=ch
    local bb=Instance.new("BillboardGui"); bb.Name="ESPbb"; bb.Size=UDim2.new(0,110,0,28); bb.StudsOffset=Vector3.new(0,3.8,0); bb.AlwaysOnTop=true
    bb.Adornee=ch:FindFirstChild("HumanoidRootPart") or ch:FindFirstChildWhichIsA("BasePart"); bb.Parent=ch
    local nl=Instance.new("TextLabel"); nl.Size=UDim2.new(1,0,1,0); nl.BackgroundTransparency=1
    nl.Text="⬥ "..p.Name; nl.TextColor3=Color3.new(1,1,1); nl.TextSize=13; nl.Font=Enum.Font.GothamBold; nl.TextStrokeTransparency=0; nl.Parent=bb
    espHL[p]=h
end
local function remESP(p)
    if espHL[p] then espHL[p]:Destroy(); espHL[p]=nil end
    local ch=p.Character; if ch then local b=ch:FindFirstChild("ESPbb"); if b then b:Destroy() end end
end
local function clearESP() for p in pairs(espHL) do remESP(p) end end
local function refreshESP() if not espOn then clearESP(); return end; for _,p in ipairs(Players:GetPlayers()) do addESP(p) end end
Players.PlayerAdded:Connect(function(p) if espOn then p.CharacterAdded:Connect(function() task.wait(0.5); addESP(p) end) end end)
Players.PlayerRemoving:Connect(remESP)

-- ── FLOAT ─────────────────────────────────────────────────────────────
local function startFloat()
    local hrp=getHRP(); if not hrp then return end
    if hrp:FindFirstChild("_floatBV") then hrp:FindFirstChild("_floatBV"):Destroy() end
    floatBV=Instance.new("BodyVelocity"); floatBV.Name="_floatBV"
    floatBV.MaxForce=Vector3.new(0,1e4,0); floatBV.Velocity=Vector3.new(0,8,0); floatBV.Parent=hrp
    local hum=getHum(); if hum then hum.PlatformStand=false end
end
local function stopFloat()
    if floatBV and floatBV.Parent then floatBV:Destroy() end; floatBV=nil
end

-- ── SPIN ──────────────────────────────────────────────────────────────
local function startSpin()
    spinOn=true
    spinConn=RunService.Heartbeat:Connect(function()
        local hrp=getHRP(); if not hrp then return end
        hrp.CFrame=hrp.CFrame*CFrame.Angles(0,math.rad(8),0)
    end)
end
local function stopSpin()
    spinOn=false; if spinConn then spinConn:Disconnect(); spinConn=nil end
end

-- ── RAINBOW ───────────────────────────────────────────────────────────
local rainbowHue=0
local function startRainbow()
    rainbowOn=true
    rainbowConn=RunService.Heartbeat:Connect(function()
        local ch=getChar(); if not ch then return end
        rainbowHue=(rainbowHue+0.5)%360
        local col=Color3.fromHSV(rainbowHue/360,1,1)
        for _,p in ipairs(ch:GetDescendants()) do
            if p:IsA("BasePart") and p.Name~="HumanoidRootPart" then p.Color=col end
        end
    end)
end
local function stopRainbow()
    rainbowOn=false; if rainbowConn then rainbowConn:Disconnect(); rainbowConn=nil end
    local ch=getChar(); if not ch then return end
    for _,p in ipairs(ch:GetDescendants()) do
        if p:IsA("BasePart") then p.Color=Color3.fromRGB(163,162,165) end
    end
end

-- ── TRAIL ─────────────────────────────────────────────────────────────
local function startTrail()
    local hrp=getHRP(); if not hrp then return end
    if hrp:FindFirstChild("_trail") then hrp:FindFirstChild("_trail"):Destroy() end
    local a0=Instance.new("Attachment"); a0.Position=Vector3.new(0,1,0); a0.Parent=hrp
    local a1=Instance.new("Attachment"); a1.Position=Vector3.new(0,-1,0); a1.Parent=hrp
    trailObj=Instance.new("Trail"); trailObj.Name="_trail"
    trailObj.Attachment0=a0; trailObj.Attachment1=a1
    trailObj.Lifetime=0.6; trailObj.MinLength=0
    trailObj.Color=ColorSequence.new({
        ColorSequenceKeypoint.new(0,Color3.fromHSV(0,1,1)),
        ColorSequenceKeypoint.new(0.5,Color3.fromHSV(0.5,1,1)),
        ColorSequenceKeypoint.new(1,Color3.fromHSV(1,1,1)),
    })
    trailObj.Parent=hrp; trailOn=true
end
local function stopTrail()
    trailOn=false
    local hrp=getHRP(); if not hrp then return end
    local t=hrp:FindFirstChild("_trail"); if t then t:Destroy() end
    for _,a in ipairs(hrp:GetChildren()) do if a:IsA("Attachment") then a:Destroy() end end
end

-- ── INVISIBLE ─────────────────────────────────────────────────────────
local function setInvis(on)
    invisOn=on
    local ch=getChar(); if not ch then return end
    for _,p in ipairs(ch:GetDescendants()) do
        if p:IsA("BasePart") and p.Name~="HumanoidRootPart" then p.LocalTransparencyModifier=on and 1 or 0 end
        if p:IsA("Decal") then p.Transparency=on and 1 or 0 end
    end
end

-- ── RESIZE ────────────────────────────────────────────────────────────
local function resizeChar(scale)
    local ch=getChar(); if not ch then return end
    local hum=getHum(); if not hum then return end
    local function setScale(name,val)
        local s=hum:FindFirstChild(name)
        if s and s:IsA("NumberValue") then s.Value=val end
    end
    setScale("BodyDepthScale",scale); setScale("BodyHeightScale",scale)
    setScale("BodyWidthScale",scale); setScale("HeadScale",scale)
end

-- ── FOLLOW ────────────────────────────────────────────────────────────
local function startFollow(target)
    followTarget=target; followOn=true
    if followConn then followConn:Disconnect() end
    followConn=RunService.Heartbeat:Connect(function()
        if not followOn then return end
        local hrp=getHRP(); if not hrp then return end
        local tch=followTarget and followTarget.Character
        local thrp=tch and tch:FindFirstChild("HumanoidRootPart")
        if not thrp then return end
        local hum=getHum(); if not hum then return end
        local dist=(thrp.Position-hrp.Position).Magnitude
        if dist>4 then
            hum:MoveTo(thrp.Position)
        end
    end)
end
local function stopFollow()
    followOn=false; followTarget=nil
    if followConn then followConn:Disconnect(); followConn=nil end
end

-- ── SPECTATE ──────────────────────────────────────────────────────────
local function startSpectate(target)
    spectateTarget=target; spectateOn=true
    local cam=workspace.CurrentCamera
    origCamType=cam.CameraType
    cam.CameraType=Enum.CameraType.Scriptable
    RunService.RenderStepped:Connect(function()
        if not spectateOn then return end
        local tch=spectateTarget and spectateTarget.Character
        local thrp=tch and tch:FindFirstChild("HumanoidRootPart")
        if thrp then
            cam.CFrame=CFrame.new(thrp.Position+Vector3.new(0,6,-12),thrp.Position)
        end
    end)
end
local function stopSpectate()
    spectateOn=false; spectateTarget=nil
    local cam=workspace.CurrentCamera
    if origCamType then cam.CameraType=origCamType end
end

-- ── AIM ASSIST HELPERS ────────────────────────────────────────────────
local function aimIsValid(player)
    if player == ME then return false end

    -- Team check: skip teammates, only target enemies
    -- If the game uses Teams, ME.Team is set. nil means no team (FFA) → treat everyone as enemy.
    if ME.Team ~= nil and player.Team == ME.Team then return false end

    local ch = player.Character
    if not ch then return false end
    local hum = ch:FindFirstChildOfClass("Humanoid")
    if not hum or hum.Health <= 0 then return false end
    return ch:FindFirstChild("HumanoidRootPart") ~= nil
end

-- Acquire nearest target within FOV cone; once locked, track by proximity only
local function aimFindTarget()
    local localChar = getChar()
    if not localChar then aimLockedTarget = nil; return nil end

    local cam      = workspace.CurrentCamera
    local camPos   = cam.CFrame.Position
    local camLook  = cam.CFrame.LookVector

    -- Validate existing lock: keep it if still alive and in range
    if aimLockedTarget and aimLockedTarget.Parent then
        local owner = Players:GetPlayerFromCharacter(aimLockedTarget.Parent)
        if owner and aimIsValid(owner) then
            local dist = (aimLockedTarget.Position - camPos).Magnitude
            if dist <= aimDist then
                return aimLockedTarget   -- stay locked
            end
        end
    end
    aimLockedTarget = nil  -- old lock invalid, pick a new one

    -- Acquire: find nearest player within FOV cone
    local bestPart = nil
    local bestDist = aimDist

    for _, player in ipairs(Players:GetPlayers()) do
        if aimIsValid(player) then
            local ch   = player.Character
            local part = aimHead
                and (ch:FindFirstChild("Head") or ch:FindFirstChild("HumanoidRootPart"))
                or  ch:FindFirstChild("HumanoidRootPart")

            if part then
                local toTarget = part.Position - camPos
                local dist     = toTarget.Magnitude

                if dist <= aimDist then
                    local angle = math.deg(math.acos(math.clamp(camLook:Dot(toTarget.Unit), -1, 1)))
                    if angle <= aimFOV and dist < bestDist then
                        local params = RaycastParams.new()
                        params.FilterDescendantsInstances = {localChar, ch}
                        params.FilterType = Enum.RaycastFilterType.Exclude
                        if not workspace:Raycast(camPos, toTarget.Unit * dist, params) then
                            bestDist = dist
                            bestPart = part
                        end
                    end
                end
            end
        end
    end

    aimLockedTarget = bestPart
    return bestPart
end

-- ══════════════════════════════════════════════════════════════════════
--  BUILD TABS
-- ══════════════════════════════════════════════════════════════════════
local movPage   = makeTab("🏃","Movement")
local visPage   = makeTab("👁","Visuals")
local funPage   = makeTab("💥","Fun")
local cosPage   = makeTab("🌈","Cosmetics")
local worldPage = makeTab("🌍","World")
local tpPage    = makeTab("🌀","Teleport")
local aimPage   = makeTab("🎯","Aim Assist")   -- NEW

-- ── MOVEMENT ──────────────────────────────────────────────────────────
makeToggle(movPage,"Fly","Soar freely through the air",function(on) if on then startFly() else stopFly() end end)
makeSlider(movPage,"Fly Speed",1,200,50,function(v) flySpeed=v end)
makeToggle(movPage,"Noclip","Walk through walls",function(on) nc=on end)
makeSlider(movPage,"Walk Speed",1,150,16,function(v) local h=getHum(); if h then h.WalkSpeed=v end end)
makeSlider(movPage,"Jump Power",1,300,50,function(v) local h=getHum(); if h then h.JumpPower=v end end)
makeToggle(movPage,"Infinite Jump","Jump again mid-air",function(on) infJump=on end)
makeToggle(movPage,"Float","Slowly rise into the air like a balloon",function(on) if on then startFloat() else stopFloat() end end)
makeToggle(movPage,"Spin","Spin your character around",function(on) if on then startSpin() else stopSpin() end end)

-- ── VISUALS ───────────────────────────────────────────────────────────
makeToggle(visPage,"ESP","See all players through walls",function(on) espOn=on; refreshESP() end)
makeToggle(visPage,"God Mode","Health stays at max",function(on) god=on end)
makeToggle(visPage,"Invisible","Make your character invisible",function(on) setInvis(on) end)

-- ── COSMETICS ─────────────────────────────────────────────────────────
makeToggle(cosPage,"Rainbow Character","Cycle through all colours",function(on) if on then startRainbow() else stopRainbow() end end)
makeToggle(cosPage,"Rainbow Trail","Leave a rainbow trail behind you",function(on) if on then startTrail() else stopTrail() end end)

do -- Size control
    local sizeCard=card(cosPage,64)
    mkLabel(sizeCard,{Size=UDim2.new(1,-70,0,18),Position=UDim2.new(0,14,0,10),Text="Character Size",TextSize=13,TextColor3=C.text})
    local vl=mkLabel(sizeCard,{Size=UDim2.new(0,52,0,18),Position=UDim2.new(1,-62,0,10),Text="1.0",TextSize=13,TextColor3=C.accent,TextXAlignment=Enum.TextXAlignment.Right})
    local track=mkFrame(sizeCard,{Size=UDim2.new(1,-28,0,6),Position=UDim2.new(0,14,0,42),BackgroundColor3=C.pill_off}); mkCorner(track,3)
    local fill=mkFrame(track,{Size=UDim2.new(0.25,0,1,0),BackgroundColor3=C.purple}); mkCorner(fill,3)
    local sk=mkBtn(track,{Size=UDim2.new(0,16,0,16),AnchorPoint=Vector2.new(0.5,0.5),Position=UDim2.new(0.25,0,0.5,0),BackgroundColor3=Color3.new(1,1,1),Text="",ZIndex=5}); mkCorner(sk,8)
    local drag=false
    sk.MouseButton1Down:Connect(function() drag=true end)
    UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then drag=false end end)
    UserInputService.InputChanged:Connect(function(i)
        if not drag or i.UserInputType~=Enum.UserInputType.MouseMovement then return end
        local r=math.clamp((i.Position.X-track.AbsolutePosition.X)/track.AbsoluteSize.X,0,1)
        local v=math.floor((0.25+r*2.75)*10)/10
        fill.Size=UDim2.new(r,0,1,0); sk.Position=UDim2.new(r,0,0.5,0)
        vl.Text=tostring(v); resizeChar(v)
    end)
    makeButton(cosPage,"Reset Size",C.sub,function() resizeChar(1) end)
end

-- ── FUN / FLING ───────────────────────────────────────────────────────
do
    local hdr=card(funPage,50); mkStroke(hdr,C.orange,1)
    mkLabel(hdr,{Size=UDim2.new(1,0,0,22),Position=UDim2.new(0,14,0,6),Text="💥  Fling Player",TextSize=14,TextColor3=C.orange})
    mkLabel(hdr,{Size=UDim2.new(1,0,0,16),Position=UDim2.new(0,14,0,28),Text="Server-side — requires FlingHandler script",TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub})
    makeSlider(funPage,"Fling Power",50,1000,150,function(v) flingPow=v end)
    local flingTarget=nil
    local _,_,setFS,getFS=makePlayerList(funPage,160,function(p,ss) flingTarget=p; ss("✅  Targeting: "..p.Name,C.green) end)
    local fbCard=card(funPage,48); mkStroke(fbCard,C.orange,1)
    local fBtn=mkBtn(fbCard,{Size=UDim2.new(1,-20,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=C.orange,Text="💥  FLING Selected",TextColor3=Color3.new(1,1,1),TextSize=13}); mkCorner(fBtn,8)
    fBtn.MouseButton1Click:Connect(function()
        local t=getFS(); if not t then setFS("⚠️  Select a player first!",C.yellow); return end
        if not FlingRE then setFS("⚠️  FlingHandler server script missing!",C.red); return end
        FlingRE:FireServer(t.Name,flingPow); setFS("💥  Flung "..t.Name.."! 😂",C.green)
        TweenService:Create(fBtn,TW,{BackgroundColor3=C.green}):Play()
        task.delay(0.4,function() TweenService:Create(fBtn,TW,{BackgroundColor3=C.orange}):Play() end)
    end)
    local faCard=card(funPage,48)
    local faBtn=mkBtn(faCard,{Size=UDim2.new(1,-20,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=Color3.fromRGB(110,0,0),Text="💣  FLING ALL",TextColor3=Color3.new(1,1,1),TextSize=13}); mkCorner(faBtn,8)
    faBtn.MouseButton1Click:Connect(function()
        if not FlingRE then return end
        local n=0; for _,p in ipairs(Players:GetPlayers()) do if p~=ME then FlingRE:FireServer(p.Name,flingPow); n+=1 end end
        setFS("💣  Flung "..n.." player(s)! 😂",C.green)
        TweenService:Create(faBtn,TW,{BackgroundColor3=C.green}):Play()
        task.delay(0.4,function() TweenService:Create(faBtn,TW,{BackgroundColor3=Color3.fromRGB(110,0,0)}):Play() end)
    end)

    -- Follow player
    local followHdr=card(funPage,50); mkStroke(followHdr,C.pink,1)
    mkLabel(followHdr,{Size=UDim2.new(1,0,0,22),Position=UDim2.new(0,14,0,6),Text="🚶  Follow Player",TextSize=14,TextColor3=C.pink})
    mkLabel(followHdr,{Size=UDim2.new(1,0,0,16),Position=UDim2.new(0,14,0,28),Text="Auto-walk toward a selected player",TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub})
    local followTarget2=nil
    local _,_,setFollowS,getFollowS=makePlayerList(funPage,140,function(p,ss) followTarget2=p; ss("✅  Will follow: "..p.Name,C.pink) end)
    do
        local fc=card(funPage,48); mkStroke(fc,C.pink,1)
        local startFollowBtn=mkBtn(fc,{Size=UDim2.new(0.48,-5,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=C.pink,Text="▶  Start Follow",TextColor3=Color3.new(1,1,1),TextSize=12}); mkCorner(startFollowBtn,8)
        local stopFollowBtn=mkBtn(fc,{Size=UDim2.new(0.48,-5,0,32),Position=UDim2.new(0.52,0,0.5,-16),BackgroundColor3=C.pill_off,Text="■  Stop",TextColor3=Color3.new(1,1,1),TextSize=12}); mkCorner(stopFollowBtn,8)
        startFollowBtn.MouseButton1Click:Connect(function()
            local t=getFollowS(); if not t then setFollowS("⚠️  Select a player first!",C.yellow); return end
            startFollow(t); setFollowS("🚶  Following "..t.Name.."...",C.pink)
            TweenService:Create(startFollowBtn,TW,{BackgroundColor3=C.green}):Play()
            task.delay(0.4,function() TweenService:Create(startFollowBtn,TW,{BackgroundColor3=C.pink}):Play() end)
        end)
        stopFollowBtn.MouseButton1Click:Connect(function()
            stopFollow(); setFollowS("⛔  Stopped following",C.sub)
            TweenService:Create(stopFollowBtn,TW,{BackgroundColor3=C.red}):Play()
            task.delay(0.4,function() TweenService:Create(stopFollowBtn,TW,{BackgroundColor3=C.pill_off}):Play() end)
        end)
    end

    -- Spectate
    local specHdr=card(funPage,50); mkStroke(specHdr,C.teal,1)
    mkLabel(specHdr,{Size=UDim2.new(1,0,0,22),Position=UDim2.new(0,14,0,6),Text="📷  Spectate Player",TextSize=14,TextColor3=C.teal})
    mkLabel(specHdr,{Size=UDim2.new(1,0,0,16),Position=UDim2.new(0,14,0,28),Text="Lock your camera to another player",TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub})
    local _,_,setSpecS,getSpecS=makePlayerList(funPage,140,function(p,ss) ss("✅  Will spectate: "..p.Name,C.teal) end)
    do
        local sc=card(funPage,48); mkStroke(sc,C.teal,1)
        local startSpecBtn=mkBtn(sc,{Size=UDim2.new(0.48,-5,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=C.teal,Text="📷  Spectate",TextColor3=Color3.new(1,1,1),TextSize=12}); mkCorner(startSpecBtn,8)
        local stopSpecBtn=mkBtn(sc,{Size=UDim2.new(0.48,-5,0,32),Position=UDim2.new(0.52,0,0.5,-16),BackgroundColor3=C.pill_off,Text="■  Stop",TextColor3=Color3.new(1,1,1),TextSize=12}); mkCorner(stopSpecBtn,8)
        startSpecBtn.MouseButton1Click:Connect(function()
            local t=getSpecS(); if not t then setSpecS("⚠️  Select a player first!",C.yellow); return end
            startSpectate(t); setSpecS("📷  Spectating "..t.Name.."...",C.teal)
            TweenService:Create(startSpecBtn,TW,{BackgroundColor3=C.green}):Play()
            task.delay(0.4,function() TweenService:Create(startSpecBtn,TW,{BackgroundColor3=C.teal}):Play() end)
        end)
        stopSpecBtn.MouseButton1Click:Connect(function()
            stopSpectate(); setSpecS("⛔  Stopped spectating",C.sub)
        end)
    end
end

-- ── WORLD ─────────────────────────────────────────────────────────────
do
    makeSlider(worldPage,"Time of Day",0,24,12,function(v) Lighting.TimeOfDay=string.format("%02d:00:00",v) end)
    makeSlider(worldPage,"Gravity",0,200,196,function(v) workspace.Gravity=v end)
    makeToggle(worldPage,"Thick Fog","Add dense fog to the world",function(on)
        Lighting.FogEnd=on and 100 or 100000
        Lighting.FogStart=on and 0 or 0
        Lighting.FogColor=Color3.fromRGB(200,200,200)
    end)
    makeSlider(worldPage,"Brightness",0,10,2,function(v) Lighting.Brightness=v end)
    makeToggle(worldPage,"Freeze NPCs","Anchor all NPC models in the world",function(on)
        for _,obj in ipairs(workspace:GetDescendants()) do
            if obj:IsA("BasePart") then
                local isPlayer=false
                for _,p in ipairs(Players:GetPlayers()) do
                    if p.Character and obj:IsDescendantOf(p.Character) then isPlayer=true; break end
                end
                if not isPlayer then obj.Anchored=on end
            end
        end
    end)
end

-- ── TELEPORT ──────────────────────────────────────────────────────────
do
    local hdr=card(tpPage,50); mkStroke(hdr,C.teal,1)
    mkLabel(hdr,{Size=UDim2.new(1,0,0,22),Position=UDim2.new(0,14,0,6),Text="🌀  Teleport",TextSize=14,TextColor3=C.teal})
    mkLabel(hdr,{Size=UDim2.new(1,0,0,16),Position=UDim2.new(0,14,0,28),Text="Teleport to players or saved waypoints",TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub})

    local tpTarget=nil
    local _,_,setTPS,getTPS=makePlayerList(tpPage,150,function(p,ss) tpTarget=p; ss("✅  Will teleport to: "..p.Name,C.teal) end)
    local tpCard=card(tpPage,48); mkStroke(tpCard,C.teal,1)
    local tpBtn=mkBtn(tpCard,{Size=UDim2.new(1,-20,0,32),Position=UDim2.new(0,10,0.5,-16),BackgroundColor3=C.teal,Text="🌀  Teleport to Player",TextColor3=Color3.new(1,1,1),TextSize=13}); mkCorner(tpBtn,8)
    tpBtn.MouseButton1Click:Connect(function()
        local t=getTPS(); if not t then setTPS("⚠️  Select a player first!",C.yellow); return end
        local tch=t.Character; if not tch then setTPS("⚠️  Player has no character!",C.yellow); return end
        local thrp=tch:FindFirstChild("HumanoidRootPart"); if not thrp then return end
        local myHRP=getHRP(); if not myHRP then return end
        myHRP.CFrame=CFrame.new(thrp.Position+thrp.CFrame.LookVector*-3+Vector3.new(0,0.5,0))
        setTPS("✅  Teleported to "..t.Name.."!",C.green)
        TweenService:Create(tpBtn,TW,{BackgroundColor3=C.green}):Play()
        task.delay(0.4,function() TweenService:Create(tpBtn,TW,{BackgroundColor3=C.teal}):Play() end)
    end)

    elemOrd+=1
    local wpHdr=mkFrame(tpPage,{Size=UDim2.new(1,0,0,34),BackgroundColor3=C.card,LayoutOrder=elemOrd}); mkCorner(wpHdr,10); mkStroke(wpHdr,C.border)
    mkLabel(wpHdr,{Size=UDim2.new(1,-136,1,0),Position=UDim2.new(0,12,0,0),Text="📍  Waypoints",TextSize=12,TextColor3=C.text})
    local saveBtn=mkBtn(wpHdr,{Size=UDim2.new(0,78,0,22),Position=UDim2.new(1,-134,0.5,-11),BackgroundColor3=C.green,Text="+ Save Here",TextColor3=Color3.new(1,1,1),TextSize=10}); mkCorner(saveBtn,6)
    local clrBtn=mkBtn(wpHdr,{Size=UDim2.new(0,46,0,22),Position=UDim2.new(1,-50,0.5,-11),BackgroundColor3=C.red,Text="Clear",TextColor3=Color3.new(1,1,1),TextSize=10}); mkCorner(clrBtn,6)

    elemOrd+=1
    local wpOuter=mkFrame(tpPage,{Size=UDim2.new(1,0,0,160),BackgroundColor3=Color3.fromRGB(18,18,28),LayoutOrder=elemOrd,ClipsDescendants=true}); mkCorner(wpOuter,10); mkStroke(wpOuter,C.border)
    local wpSF=Instance.new("ScrollingFrame"); wpSF.Size=UDim2.new(1,0,1,0); wpSF.BackgroundTransparency=1; wpSF.BorderSizePixel=0
    wpSF.ScrollBarThickness=5; wpSF.ScrollBarImageColor3=C.teal; wpSF.CanvasSize=UDim2.new(0,0,0,0)
    wpSF.AutomaticCanvasSize=Enum.AutomaticSize.Y; wpSF.ScrollingDirection=Enum.ScrollingDirection.Y; wpSF.Parent=wpOuter
    do
        local ul=Instance.new("UIListLayout"); ul.SortOrder=Enum.SortOrder.LayoutOrder; ul.Padding=UDim.new(0,4); ul.Parent=wpSF
        local up=Instance.new("UIPadding"); up.PaddingLeft=UDim.new(0,6); up.PaddingRight=UDim.new(0,10); up.PaddingTop=UDim.new(0,6); up.PaddingBottom=UDim.new(0,6); up.Parent=wpSF
    end
    local waypoints={}; local wpCount=0
    local function rebuildWP()
        for _,c in ipairs(wpSF:GetChildren()) do if not c:IsA("UIListLayout") and not c:IsA("UIPadding") then c:Destroy() end end
        if #waypoints==0 then mkLabel(wpSF,{Size=UDim2.new(1,0,0,44),Text="No waypoints yet — press '+ Save Here'",TextSize=11,Font=Enum.Font.Gotham,TextColor3=C.sub,TextXAlignment=Enum.TextXAlignment.Center}); return end
        for i,wp in ipairs(waypoints) do
            local row=mkFrame(wpSF,{Size=UDim2.new(1,0,0,40),BackgroundColor3=C.row,LayoutOrder=i}); mkCorner(row,8)
            local ic=mkFrame(row,{Size=UDim2.new(0,28,0,28),Position=UDim2.new(0,6,0.5,-14),BackgroundColor3=C.teal}); mkCorner(ic,14)
            mkLabel(ic,{Size=UDim2.new(1,0,1,0),Text="📍",TextSize=13,TextXAlignment=Enum.TextXAlignment.Center})
            mkLabel(row,{Size=UDim2.new(1,-134,0,18),Position=UDim2.new(0,42,0,4),Text=wp.name,TextSize=12,TextColor3=C.text})
            mkLabel(row,{Size=UDim2.new(1,-134,0,14),Position=UDim2.new(0,42,0,22),Text=string.format("%.0f, %.0f, %.0f",wp.pos.X,wp.pos.Y,wp.pos.Z),TextSize=10,Font=Enum.Font.Gotham,TextColor3=C.sub})
            local goBtn=mkBtn(row,{Size=UDim2.new(0,36,0,24),Position=UDim2.new(1,-82,0.5,-12),BackgroundColor3=C.teal,Text="Go",TextColor3=Color3.new(1,1,1),TextSize=11}); mkCorner(goBtn,6)
            goBtn.MouseButton1Click:Connect(function()
                local hrp=getHRP(); if not hrp then return end
                hrp.CFrame=CFrame.new(wp.pos+Vector3.new(0,0.5,0))
                TweenService:Create(goBtn,TW,{BackgroundColor3=C.green}):Play()
                task.delay(0.4,function() TweenService:Create(goBtn,TW,{BackgroundColor3=C.teal}):Play() end)
            end)
            local delBtn=mkBtn(row,{Size=UDim2.new(0,36,0,24),Position=UDim2.new(1,-40,0.5,-12),BackgroundColor3=Color3.fromRGB(80,0,0),Text="✕",TextColor3=Color3.new(1,1,1),TextSize=11}); mkCorner(delBtn,6)
            delBtn.MouseButton1Click:Connect(function() table.remove(waypoints,i); rebuildWP() end)
        end
    end
    rebuildWP()
    saveBtn.MouseButton1Click:Connect(function()
        local hrp=getHRP(); if not hrp then return end
        wpCount+=1; table.insert(waypoints,{name="Waypoint "..wpCount,pos=hrp.Position}); rebuildWP()
        TweenService:Create(saveBtn,TW,{BackgroundColor3=C.accent}):Play()
        task.delay(0.4,function() TweenService:Create(saveBtn,TW,{BackgroundColor3=C.green}):Play() end)
    end)
    clrBtn.MouseButton1Click:Connect(function() waypoints={}; rebuildWP() end)
end

-- ── AIM ASSIST TAB ────────────────────────────────────────────────────
do
    local hdr = card(aimPage, 50); mkStroke(hdr, C.accent, 1)
    mkLabel(hdr, {Size=UDim2.new(1,0,0,22), Position=UDim2.new(0,14,0,6),  Text="🎯  Aim Assist", TextSize=14, TextColor3=C.accent})
    mkLabel(hdr, {Size=UDim2.new(1,0,0,16), Position=UDim2.new(0,14,0,28), Text="Smoothly pulls your camera toward the nearest target", TextSize=11, Font=Enum.Font.Gotham, TextColor3=C.sub})

    -- Master toggle
    makeToggle(aimPage, "Enable Aim Assist", "Activate the aim assist system",
        function(on) aimOn = on end)

    -- Hold-to-activate toggle
    makeToggle(aimPage, "Hold Right-Click to Activate", "Only assist while right mouse button is held",
        function(on) aimHoldOnly = on end)

    -- Aim at head toggle
    makeToggle(aimPage, "Aim at Head", "Target the head instead of center of body",
        function(on) aimHead = on end)

    -- FOV slider  (5 – 60 degrees)
    makeSlider(aimPage, "Detection FOV", 5, 60, 25,
        function(v) aimFOV = v end)

    -- Smoothness slider (1 – 20, mapped to 0.01 – 0.20)
    makeSlider(aimPage, "Smoothness", 1, 20, 8,
        function(v) aimSmooth = v end)

    -- Distance slider (20 – 500 studs)
    makeSlider(aimPage, "Max Distance (studs)", 20, 500, 150,
        function(v) aimDist = v end)

    -- Info card
    local infoCard = card(aimPage, 44)
    mkLabel(infoCard, {
        Size     = UDim2.new(1,-16,1,0),
        Position = UDim2.new(0,10,0,0),
        Text     = "💡  Lower FOV = tighter cone.  Higher Smoothness = snappier pull.",
        TextSize = 11,
        Font     = Enum.Font.Gotham,
        TextColor3 = C.sub,
        TextWrapped = true,
    })
end

-- ══════════════════════════════════════════════════════════════════════
--  RUNTIME
-- ══════════════════════════════════════════════════════════════════════
RunService.Heartbeat:Connect(function()
    if fly then
        local hrp=getHRP()
        if hrp and bv and bv.Parent then
            local cam=workspace.CurrentCamera; local d=Vector3.zero
            if UserInputService:IsKeyDown(Enum.KeyCode.W) then d+=cam.CFrame.LookVector end
            if UserInputService:IsKeyDown(Enum.KeyCode.S) then d-=cam.CFrame.LookVector end
            if UserInputService:IsKeyDown(Enum.KeyCode.A) then d-=cam.CFrame.RightVector end
            if UserInputService:IsKeyDown(Enum.KeyCode.D) then d+=cam.CFrame.RightVector end
            if UserInputService:IsKeyDown(Enum.KeyCode.Space)     then d+=Vector3.yAxis end
            if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then d-=Vector3.yAxis end
            bv.Velocity=(d.Magnitude>0 and d.Unit or Vector3.zero)*flySpeed; bg2.CFrame=cam.CFrame
        end
    end
    if nc then local ch=getChar(); if ch then for _,p in ipairs(ch:GetDescendants()) do if p:IsA("BasePart") then p.CanCollide=false end end end end
    if god then local h=getHum(); if h then h.Health=h.MaxHealth end end
    if espOn then
        for _,p in ipairs(Players:GetPlayers()) do
            if p~=ME then
                if p.Character and not espHL[p] then addESP(p)
                elseif not p.Character and espHL[p] then remESP(p) end
            end
        end
    end
    if invisOn then
        local ch=getChar(); if ch then
            for _,p in ipairs(ch:GetDescendants()) do
                if p:IsA("BasePart") and p.Name~="HumanoidRootPart" then p.LocalTransparencyModifier=1 end
            end
        end
    end
end)

-- ── AIM ASSIST LOOP ───────────────────────────────────────────────────
-- Runs AFTER Roblox's own camera update (Camera priority + 1) so our
-- CFrame write is the last one each frame and cannot be overridden.
RunService:BindToRenderStep("kAaMsAimAssist", Enum.RenderPriority.Camera.Value + 1, function()
    if not aimOn then aimLockedTarget = nil; return end

    -- Activation gate
    if aimHoldOnly and not UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
        aimLockedTarget = nil; return
    end

    local target = aimFindTarget()
    if not target then return end

    local cam      = workspace.CurrentCamera
    local camPos   = cam.CFrame.Position
    local toTarget = (target.Position - camPos).Unit

    -- Hard lock: snap directly to target, bypassing any camera script
    local lockedCF = CFrame.lookAt(camPos, camPos + toTarget)

    -- Optional smoothing: aimSmooth 1 = gentle pull, 20 = instant snap
    local factor = math.clamp(aimSmooth / 20, 0.05, 1)
    cam.CFrame = cam.CFrame:Lerp(lockedCF, factor)
end)

UserInputService.JumpRequest:Connect(function()
    if infJump then local h=getHum(); if h then h:ChangeState(Enum.HumanoidStateType.Jumping) end end
end)

UserInputService.InputBegan:Connect(function(inp,gp)
    if gp then return end
    if inp.KeyCode==Enum.KeyCode.Five then WIN.Visible=not WIN.Visible end
end)

ME.CharacterAdded:Connect(function(ch)
    fly=false; bv=nil; bg2=nil; floatOn=false; floatBV=nil
    spinOn=false; rainbowOn=false; trailOn=false; invisOn=false
    if spinConn then spinConn:Disconnect(); spinConn=nil end
    if rainbowConn then rainbowConn:Disconnect(); rainbowConn=nil end
    local h=ch:WaitForChild("Humanoid",5); if h then h.PlatformStand=false end
end)
Script worked? 🚀 Boost it to #1 so others find it too.

Comments (4)

Log in to add a comment.

sondeo111

sondeo111

3 months ago

says fling handler is missing

Mezi

Mezi

7 months ago

Gqg

radraiden517973

radraiden517973

7 months ago

This is hella good bro

gamerkaam356

gamerkaam356Author

7 months ago

Thank you please leave a like

gamerkaam356

gamerkaam356Author

7 months ago

Works perfectly, if not please notify