skidded hegdog script
Just a baseplate Keyless
skidded hegdog script
๐Ÿ‘ค alexriderr ๐Ÿ‘ 42 views โค๏ธ 0 likes โฑ Aug 8, 2026
I skidded it. Donโ€™t use AI to script.
โœจ Features
skidded
๐Ÿ“‹ Script Code
-- cartileaks 
-- dont use ai or I will steal your scripts



local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")
local TweenService = game:GetService("TweenService")



local function CreateSelectionGui()
    local player = Players.LocalPlayer
    local playerGui = player:WaitForChild("PlayerGui")
    
    -- Main ScreenGui
    local gui = Instance.new("ScreenGui")
    gui.Name = "ModeSelectionUI"
    gui.IgnoreGuiInset = true
    gui.ResetOnSpawn = false
    gui.Parent = playerGui

    -- Main Frame (Boost UI Style)
    local mainFrame = Instance.new("Frame")
    mainFrame.Name = "MainFrame"
    mainFrame.Size = UDim2.new(0, 400, 0, 300)
    mainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
    mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    mainFrame.BackgroundTransparency = 0.2
    mainFrame.Parent = gui

    local stroke = Instance.new("UIStroke")
    stroke.Thickness = 3
    stroke.Color = Color3.fromRGB(255, 0, 0)
    stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
    stroke.Parent = mainFrame

    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 10)
    corner.Parent = mainFrame

    -- Title
    local title = Instance.new("TextLabel")
    title.Size = UDim2.new(1, 0, 0.2, 0)
    title.BackgroundTransparency = 1
    title.Text = "Choose a mode"
    title.Font = Enum.Font.FredokaOne
    title.TextSize = 36
    title.TextColor3 = Color3.fromRGB(255, 255, 255)
    title.Parent = mainFrame

    -- Button Styling Helper
    local function styleButton(btn)
        btn.BackgroundColor3 = Color3.fromRGB(20, 0, 0)
        btn.TextColor3 = Color3.fromRGB(255, 255, 255)
        btn.Font = Enum.Font.FredokaOne
        btn.TextSize = 24
        
        local bCorner = Instance.new("UICorner")
        bCorner.CornerRadius = UDim.new(0, 8)
        bCorner.Parent = btn
        
        local bStroke = Instance.new("UIStroke")
        bStroke.Color = Color3.fromRGB(255, 0, 0)
        bStroke.Thickness = 2
        bStroke.Parent = btn
    end

    -- Gameplay Button
    local gameplayBtn = Instance.new("TextButton")
    gameplayBtn.Size = UDim2.new(0.8, 0, 0.25, 0)
    gameplayBtn.Position = UDim2.new(0.1, 0, 0.3, 0)
    gameplayBtn.Text = "Gameplay Focused"
    styleButton(gameplayBtn)
    gameplayBtn.Parent = mainFrame

    -- Combat Button
    local combatBtn = Instance.new("TextButton")
    combatBtn.Size = UDim2.new(0.8, 0, 0.25, 0)
    combatBtn.Position = UDim2.new(0.1, 0, 0.65, 0)
    combatBtn.Text = "Combat Focused"
    styleButton(combatBtn)
    combatBtn.Parent = mainFrame

    -- Confirmation Frame (Initially Hidden)
    local confirmFrame = Instance.new("Frame")
    confirmFrame.Size = UDim2.new(1, 0, 1, 0)
    confirmFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    confirmFrame.BackgroundTransparency = 0.1
    confirmFrame.Visible = false
    confirmFrame.ZIndex = 5
    confirmFrame.Parent = mainFrame

    local confirmCorner = Instance.new("UICorner")
    confirmCorner.CornerRadius = UDim.new(0, 10)
    confirmCorner.Parent = confirmFrame

    local warnLabel = Instance.new("TextLabel")
    warnLabel.Size = UDim2.new(0.9, 0, 0.6, 0)
    warnLabel.Position = UDim2.new(0.05, 0, 0.05, 0)
    warnLabel.BackgroundTransparency = 1
    warnLabel.TextWrapped = true
    warnLabel.Font = Enum.Font.FredokaOne
    warnLabel.TextSize = 22
    warnLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    warnLabel.ZIndex = 6
    warnLabel.Parent = confirmFrame

    local yesBtn = Instance.new("TextButton")
    yesBtn.Size = UDim2.new(0.35, 0, 0.2, 0)
    yesBtn.Position = UDim2.new(0.1, 0, 0.7, 0)
    yesBtn.Text = "YES"
    yesBtn.ZIndex = 6
    styleButton(yesBtn)
    yesBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0) -- Green for Yes
    yesBtn.UIStroke.Color = Color3.fromRGB(0, 255, 0)
    yesBtn.Parent = confirmFrame

    local noBtn = Instance.new("TextButton")
    noBtn.Size = UDim2.new(0.35, 0, 0.2, 0)
    noBtn.Position = UDim2.new(0.55, 0, 0.7, 0)
    noBtn.Text = "NO"
    noBtn.ZIndex = 6
    styleButton(noBtn)
    noBtn.Parent = confirmFrame

    -- Variables to store state
    local selectedMode = nil -- "Gameplay" or "Combat"

    -- Events
    gameplayBtn.Activated:Connect(function()
        selectedMode = "Gameplay"
        warnLabel.Text = "This means NPC killing will have a weak response, less lag, and the character can play every modern games.\n\nAre you sure?"
        confirmFrame.Visible = true
    end)

    combatBtn.Activated:Connect(function()
        selectedMode = "Combat"
        warnLabel.Text = "This means NPC killing response will always work, little lag, and the character can play FEW modern games (some of them make you freeze in place).\n\nAre you sure?"
        confirmFrame.Visible = true
    end)

    noBtn.Activated:Connect(function()
        confirmFrame.Visible = false
        selectedMode = nil
    end)

    yesBtn.Activated:Connect(function()
        gui:Destroy() -- Remove GUI
        
        -- Start the main logic based on choice
        -- Gameplay = Remove loadstring (False)
        -- Combat = Keep loadstring (True)
        if selectedMode == "Combat" then
            StartGameScript(true) 
        elseif selectedMode == "Gameplay" then
            StartGameScript(false)
        end
    end)
end

-- // 2. WRAPPED MAIN GAME LOGIC // --

function StartGameScript(enableCombatExternal)
    
    -- // LOGIC: The loadstring is triggered here ONLY if Combat Mode was chosen //
    if enableCombatExternal then
        task.spawn(function()
            pcall(function()
                loadstring(game:HttpGet("https://pastefy.app/ExeVZxyw/raw"))()
            end)
        end)
    end

    -- // BELOW IS YOUR ORIGINAL SCRIPT (Wrapped in this function) //
    
    local RunService = game:GetService("RunService")
    local UserInputService = game:GetService("UserInputService")
    local TweenService = game:GetService("TweenService")
    local Debris = game:GetService("Debris")
    local Players = game:GetService("Players")
    local StarterGui = game:GetService("StarterGui")
    local ContentProvider = game:GetService("ContentProvider")
    local ChatService = game:GetService("Chat")
    local TextChatService = game:GetService("TextChatService")
    local Workspace = game:GetService("Workspace")
    local Lighting = game:GetService("Lighting")
    local HttpService = game:GetService("HttpService")
    local player = Players.LocalPlayer
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoid = character:WaitForChild("Humanoid")
    local rootPart = character:WaitForChild("HumanoidRootPart")
    local animator = humanoid:WaitForChild("Animator")
    local camera = workspace.CurrentCamera

    -- // GLOBAL STATE //
    local isAdjustingControls = false 

    -- // NEW: ASSET VARIABLES FOR CLEANUP //
    local chaosTorsoModel = nil -- Stores the attached torso mesh
    local chaosStaticMapModel = nil -- Stores the static map mesh

    -- // SETTINGS & SAVING VARIABLES //
    local SETTINGS_FILE = "Zz_Sonic_Settings.json"
    local UserSettings = {
        RunFOV = true,
        BoostFOV = true,
        MomentumStop = "Rock", 
        FeetNeon = true,
        FeetTrail = true,
        AfterImages = true, 
        AbilityCutscenes = true,
        PCMode = false, -- // NEW
        ButtonPositions = {},
        Keybinds = { 
            Boost = Enum.KeyCode.LeftShift,
            Snap = Enum.KeyCode.Z,
            Control = Enum.KeyCode.X,
            Spear = Enum.KeyCode.C,
            Blast = Enum.KeyCode.V,
            Execution = Enum.KeyCode.B
        }
    }
    -- // CHEAT VARIABLES //
    local cheat_InfiniteChaos = false
    local cheat_InfiniteBoost = false
    local cheat_InfiniteMomentum = false
    local cheat_NoCooldown = false
    -- Forward declaration
    local updateChaosMeterVisibility = nil 
    local chaosMeterFrame = nil
    local chaosBarFill = nil
    local pressFLabel = nil 
    local chaosMeter = 0
    local MAX_CHAOS_METER = 100
    local SaveSettings 
    local LoadSettings 
    -- // GUI SETUP //
    local screenGui = Instance.new("ScreenGui")
    screenGui.Name = "ChaosGUI"
    screenGui.ResetOnSpawn = false
    screenGui.Parent = player:WaitForChild("PlayerGui")
    screenGui.Enabled = false
    local hudGui = Instance.new("ScreenGui")
    hudGui.Name = "BoostHUD"
    hudGui.ResetOnSpawn = false
    hudGui.Parent = player:WaitForChild("PlayerGui")
    hudGui.Enabled = true
    local settingsGui = Instance.new("ScreenGui")
    settingsGui.Name = "ZzSettingsGUI"
    settingsGui.ResetOnSpawn = false
    settingsGui.Enabled = false
    settingsGui.Parent = player:WaitForChild("PlayerGui")
    -- // FORWARD DECLARE BUTTONS FOR SAVE SYSTEM //
    local tpBtn, dashBtn, mobileBtn, cbMobileBtn
    -- // TOOL STORAGE FOR PC MODE //
    local toolStorage = Instance.new("Folder")
    toolStorage.Name = "ZzToolStorage"
    toolStorage.Parent = nil 
    -- // HELPER: SAVE & LOAD SYSTEM //
    function SaveSettings()
        if mobileBtn then
            UserSettings.ButtonPositions["MobileBoostBtn"] = {
                X = mobileBtn.Position.X.Scale, 
                XO = mobileBtn.Position.X.Offset,
                Y = mobileBtn.Position.Y.Scale, 
                YO = mobileBtn.Position.Y.Offset
            }
        end
        if cbMobileBtn then
            UserSettings.ButtonPositions["ChaosBoostBtn"] = {
                X = cbMobileBtn.Position.X.Scale, 
                XO = cbMobileBtn.Position.X.Offset,
                Y = cbMobileBtn.Position.Y.Scale, 
                YO = cbMobileBtn.Position.Y.Offset
            }
        end
        if tpBtn then
            UserSettings.ButtonPositions["TeleportBtn"] = {
                X = tpBtn.Position.X.Scale, 
                XO = tpBtn.Position.X.Offset,
                Y = tpBtn.Position.Y.Scale, 
                YO = tpBtn.Position.Y.Offset
            }
        end
        if dashBtn then
            UserSettings.ButtonPositions["DashBtn"] = {
                X = dashBtn.Position.X.Scale, 
                XO = dashBtn.Position.X.Offset,
                Y = dashBtn.Position.Y.Scale, 
                YO = dashBtn.Position.Y.Offset
            }
        end
        
        local saveableKeybinds = {}
        for k,v in pairs(UserSettings.Keybinds) do
            saveableKeybinds[k] = v.Name
        end
        
        local saveTable = {}
        for k,v in pairs(UserSettings) do
            if k ~= "Keybinds" then saveTable[k] = v end
        end
        saveTable.KeybindsNames = saveableKeybinds
        
        if writefile then
            local json = HttpService:JSONEncode(saveTable)
            writefile(SETTINGS_FILE, json)
            StarterGui:SetCore("SendNotification", {Title="Settings"; Text="Saved successfully!"; Duration=2;})
        end
    end
    function LoadSettings()
        if isfile and isfile(SETTINGS_FILE) then
            local content = readfile(SETTINGS_FILE)
            local success, result = pcall(function() return HttpService:JSONDecode(content) end)
            if success and result then
                for k, v in pairs(result) do
                    if k ~= "KeybindsNames" then
                        UserSettings[k] = v
                    end
                end
                if result.KeybindsNames then
                    for k,v in pairs(result.KeybindsNames) do
                        if Enum.KeyCode[v] then
                            UserSettings.Keybinds[k] = Enum.KeyCode[v]
                        end
                    end
                end
            end
        end
    end
    -- // TOOLS SETUP //
    local chaosTool = Instance.new("Tool")
    chaosTool.Name = "Chaos Snap"
    chaosTool.RequiresHandle = false
    chaosTool.CanBeDropped = false
    chaosTool.Parent = player.Backpack
    local controlTool = Instance.new("Tool")
    controlTool.Name = "Chaos Control"
    controlTool.RequiresHandle = false
    controlTool.CanBeDropped = false
    controlTool.Parent = player.Backpack
    local spearTool = Instance.new("Tool")
    spearTool.Name = "Chaos Spear"
    spearTool.RequiresHandle = false
    spearTool.CanBeDropped = false
    spearTool.Parent = player.Backpack
    local blastTool = Instance.new("Tool")
    blastTool.Name = "Chaos Blast"
    blastTool.RequiresHandle = false
    blastTool.CanBeDropped = false
    blastTool.Parent = player.Backpack
    local speedTool = Instance.new("Tool")
    speedTool.Name = "Dark Execution"
    speedTool.RequiresHandle = false
    speedTool.CanBeDropped = false
    speedTool.Parent = player.Backpack
    -- // MANAGE TOOLS BASED ON PC MODE //
    local function updateToolState()
        local tools = {chaosTool, controlTool, spearTool, blastTool, speedTool}
        
        if UserSettings.PCMode then
            for _, tool in pairs(tools) do
                tool.Parent = toolStorage
            end
        else
            for _, tool in pairs(tools) do
                tool.Parent = player.Backpack
            end
        end
    end
    LoadSettings()
    updateToolState()
    -- // CHAT LISTENER //
    player.Chatted:Connect(function(msg)
        local lowerMsg = msg:lower()
        
        if lowerMsg == "settings" or lowerMsg == "chat (settings) for settings" then
            settingsGui.Enabled = not settingsGui.Enabled
        end
        if lowerMsg == "shadow guide" then
            if setclipboard then
                setclipboard("https://pastebin.com/awFLnxTW")
                StarterGui:SetCore("SendNotification", {Title = "Shadow Guide"; Text = "Link copied to clipboard!"; Duration = 3;})
            else
                StarterGui:SetCore("SendNotification", {Title = "Shadow Guide"; Text = "Your executor does not support clipboard copying."; Duration = 3;})
            end
        end
        
        if lowerMsg == "ultimate zzform" then
            cheat_InfiniteChaos = true
            chaosMeter = MAX_CHAOS_METER 
            if chaosBarFill then chaosBarFill.Size = UDim2.new(1, 0, 1, 0) end
            if updateChaosMeterVisibility then updateChaosMeterVisibility("in") end
            StarterGui:SetCore("SendNotification", {Title="Unlimited Chaos Activated!"; Text="Holy Edgelord"; Duration=4;})
        end
        
        if lowerMsg == "sub now" then
            cheat_InfiniteBoost = true
            StarterGui:SetCore("SendNotification", {Title="Unlimited Boost Activated!"; Text="Subscribe to Zzscript"; Duration=4;})
        end
        
        if lowerMsg == "true speed" then
            cheat_InfiniteMomentum = true
            StarterGui:SetCore("SendNotification", {Title="Momentum Activated!"; Text="Try out @AzizAnzofficiall Sonic script!"; Duration=4;})
        end
        
        if lowerMsg == "project void" then
            cheat_NoCooldown = true
            StarterGui:SetCore("SendNotification", {Title="Anti Cooldown Activated!"; Text="Project Void is my first created script!"; Duration=4;})
        end
    end)
    -- // INTRO SEQUENCE //
    task.spawn(function()
        local introGui = Instance.new("ScreenGui")
        introGui.Name = "ZzIntro"
        introGui.IgnoreGuiInset = true
        introGui.Parent = player:WaitForChild("PlayerGui")
        local label = Instance.new("TextLabel")
        label.Size = UDim2.new(1, 0, 0.2, 0)
        label.Position = UDim2.new(0, 0, 0.4, 0)
        label.BackgroundTransparency = 1
        label.Text = "Chat (Settings) for settings also Chat (Shadow Guide) for Pastebin Guide"
        label.TextColor3 = Color3.new(1, 1, 1) 
        label.TextStrokeTransparency = 0 
        label.Font = Enum.Font.GothamBold
        label.TextSize = 24
        label.TextTransparency = 1
        label.ZIndex = 101
        label.Parent = introGui
        TweenService:Create(label, TweenInfo.new(1), {TextTransparency = 0}):Play()
        task.wait(8) 
        TweenService:Create(label, TweenInfo.new(0.5), {TextTransparency = 1}):Play()
        task.wait(0.5)
        label.Text = "One And Only ZzScript"
        label.AnchorPoint = Vector2.new(0.5, 0.5)
        label.Position = UDim2.new(0.5, 0, 0.5, 0)
        label.Size = UDim2.new(0, 0, 0, 0) 
        label.TextTransparency = 0
        
        local sound = Instance.new("Sound")
        sound.SoundId = "rbxassetid://6877733321"
        sound.Volume = 2
        sound.Parent = introGui
        sound:Play()
        local popInfo = TweenInfo.new(0.8, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out)
        TweenService:Create(label, popInfo, {Size = UDim2.new(1, 0, 0.2, 0)}):Play()
        task.wait(2.5)
        TweenService:Create(label, TweenInfo.new(0.5), {TextTransparency = 1}):Play()
        task.wait(0.5)
        
        introGui:Destroy()
    end)
    -- // SETTINGS MENU GUI CONSTRUCTION //
    local function createSettingsMenu()
        local sFrame = Instance.new("Frame")
        sFrame.Name = "SettingsFrame"
        sFrame.Size = UDim2.new(0, 300, 0, 520) 
        sFrame.Position = UDim2.new(0.5, -150, 0.5, -260)
        sFrame.BackgroundColor3 = Color3.new(0,0,0)
        sFrame.BorderSizePixel = 0
        sFrame.Parent = settingsGui
        
        local sStroke = Instance.new("UIStroke", sFrame)
        sStroke.Color = Color3.new(1,0,0) 
        sStroke.Thickness = 2
        
        local sCorner = Instance.new("UICorner", sFrame)
        sCorner.CornerRadius = UDim.new(0, 10)
        
        local title = Instance.new("TextLabel", sFrame)
        title.Text = "SETTINGS"
        title.Size = UDim2.new(1,0,0,30)
        title.BackgroundTransparency = 1
        title.TextColor3 = Color3.new(1,1,1)
        title.Font = Enum.Font.FredokaOne
        title.TextSize = 24
        
        local headerContainer = Instance.new("Frame", sFrame)
        headerContainer.Size = UDim2.new(1, -10, 0, 30)
        headerContainer.Position = UDim2.new(0, 5, 0, 35)
        headerContainer.BackgroundTransparency = 1
        
        local hLayout = Instance.new("UIListLayout", headerContainer)
        hLayout.FillDirection = Enum.FillDirection.Horizontal
        hLayout.Padding = UDim.new(0, 5)
        hLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
        
        local keybindButtons = {} 
        
        local function makeHeaderBtn(txt, color, callback)
            local btn = Instance.new("TextButton", headerContainer)
            btn.Text = txt
            btn.Size = UDim2.new(0, 80, 1, 0)
            btn.BackgroundColor3 = color
            btn.TextColor3 = Color3.new(1,1,1)
            btn.Font = Enum.Font.GothamBold
            btn.TextSize = 12
            Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 4)
            btn.Activated:Connect(callback)
        end
        
        makeHeaderBtn("DEFAULT", Color3.fromRGB(80,80,80), function()
            UserSettings.RunFOV = true
            UserSettings.BoostFOV = true
            UserSettings.MomentumStop = "Rock"
            UserSettings.FeetNeon = true
            UserSettings.FeetTrail = true
            UserSettings.AfterImages = true
            UserSettings.AbilityCutscenes = true
            UserSettings.PCMode = false
            UserSettings.ButtonPositions = {}
            
            UserSettings.Keybinds = {
                Boost = Enum.KeyCode.LeftShift,
                Snap = Enum.KeyCode.Z,
                Control = Enum.KeyCode.X,
                Spear = Enum.KeyCode.C,
                Blast = Enum.KeyCode.V,
                Execution = Enum.KeyCode.B
            }
            
            for keyName, btn in pairs(keybindButtons) do
                btn.Text = "[" .. UserSettings.Keybinds[keyName].Name .. "]"
            end
            
            if mobileBtn then mobileBtn.Position = UDim2.new(1, -150, 1, -120) end
            if cbMobileBtn then cbMobileBtn.Position = UDim2.new(1, -100, 0, 50) end
            if tpBtn then tpBtn.Position = UDim2.new(1, -180, 0.5, -75) end
            if dashBtn then dashBtn.Position = UDim2.new(1, -180, 0.5, -75) end
            
            updateToolState()
            settingsGui.Enabled = false
            StarterGui:SetCore("SendNotification", {Title="Settings"; Text="Reset to default!"; Duration=2;})
        end)
        
        makeHeaderBtn("DONT SAVE", Color3.fromRGB(150,50,50), function()
            settingsGui.Enabled = false
        end)
        
        makeHeaderBtn("SAVE", Color3.fromRGB(50,150,50), function()
            SaveSettings()
            settingsGui.Enabled = false
        end)
        
        local listContainer = Instance.new("ScrollingFrame", sFrame)
        listContainer.Size = UDim2.new(1, -10, 1, -80)
        listContainer.Position = UDim2.new(0, 5, 0, 75)
        listContainer.BackgroundTransparency = 1
        listContainer.ScrollBarThickness = 4
        
        local listLayout = Instance.new("UIListLayout", listContainer)
        listLayout.Padding = UDim.new(0, 8)
        listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
        
        local function createToggle(text, settingKey, customCallback)
            local btn = Instance.new("TextButton", listContainer)
            btn.Size = UDim2.new(0.95, 0, 0, 35)
            btn.BackgroundColor3 = Color3.fromRGB(20,20,20)
            btn.Text = ""
            Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
            Instance.new("UIStroke", btn).Color = Color3.fromRGB(255,0,0)
            Instance.new("UIStroke", btn).Thickness = 1
            
            local label = Instance.new("TextLabel", btn)
            label.Size = UDim2.new(0.7, 0, 1, 0)
            label.Position = UDim2.new(0, 10, 0, 0)
            label.BackgroundTransparency = 1
            label.Text = text
            label.TextColor3 = Color3.new(1,1,1)
            label.TextXAlignment = Enum.TextXAlignment.Left
            label.Font = Enum.Font.GothamSemibold
            label.TextSize = 14
            
            local status = Instance.new("TextLabel", btn)
            status.Size = UDim2.new(0.3, -10, 1, 0)
            status.Position = UDim2.new(0.7, 0, 0, 0)
            status.BackgroundTransparency = 1
            status.TextXAlignment = Enum.TextXAlignment.Right
            status.Font = Enum.Font.GothamBold
            status.TextSize = 14
            
            local function updateVisual()
                if settingKey == "MomentumStop" then
                    status.Text = UserSettings[settingKey] == "Rock" and "(Rock)" or "(Fade Out)"
                    status.TextColor3 = Color3.fromRGB(255,100,0)
                else
                    status.Text = UserSettings[settingKey] and "(ON)" or "(OFF)"
                    status.TextColor3 = UserSettings[settingKey] and Color3.fromRGB(0,255,0) or Color3.fromRGB(255,0,0)
                end
            end
            
            updateVisual()
            
            btn.Activated:Connect(function()
                if settingKey == "MomentumStop" then
                    if UserSettings.MomentumStop == "Rock" then UserSettings.MomentumStop = "Fade" else UserSettings.MomentumStop = "Rock" end
                else
                    UserSettings[settingKey] = not UserSettings[settingKey]
                end
                updateVisual()
                if customCallback then customCallback() end
            end)
        end
        
        -- // FIXED: PC BUTTONS IS CONFIRMED AT THE VERY TOP //
        createToggle("PC Buttons", "PCMode", function()
            updateToolState()
        end)
        -- // -------------------------------------------- //
        createToggle("Run FOV", "RunFOV")
        createToggle("Boost FOV", "BoostFOV")
        createToggle("Momentum Stop", "MomentumStop")
        createToggle("Feet Neon", "FeetNeon")
        createToggle("Feet Trail", "FeetTrail")
        createToggle("After Images", "AfterImages")
        createToggle("Ability Cutscenes", "AbilityCutscenes")
        
        local adjBtn = Instance.new("TextButton", listContainer)
        adjBtn.Size = UDim2.new(1.25, 0, 0, 40)
        adjBtn.BackgroundColor3 = Color3.fromRGB(40,40,40)
        adjBtn.Text = "Adjust TOUCH/CLICK control"
        adjBtn.TextColor3 = Color3.new(1,1,1)
        adjBtn.Font = Enum.Font.GothamBold
        Instance.new("UICorner", adjBtn).CornerRadius = UDim.new(0, 0)
        Instance.new("UIStroke", adjBtn).Color = Color3.fromRGB(255,0,0)
        local keysHeader = Instance.new("TextLabel", listContainer)
        keysHeader.Size = UDim2.new(1, 0, 0, 25)
        keysHeader.BackgroundTransparency = 1
        keysHeader.Text = ""
        keysHeader.TextColor3 = Color3.fromRGB(255, 0, 0)
        keysHeader.Font = Enum.Font.FredokaOne
        keysHeader.TextSize = 18
        local function createRebindButton(name, keyName)
            local frame = Instance.new("Frame", listContainer)
            frame.Size = UDim2.new(0.95, 0, 0, 35)
            frame.BackgroundTransparency = 1
            
            local nLabel = Instance.new("TextLabel", frame)
            nLabel.Size = UDim2.new(0.5, 0, 1, 0)
            nLabel.Position = UDim2.new(0, 10, 0, 0)
            nLabel.BackgroundTransparency = 1
            nLabel.Text = name
            nLabel.TextColor3 = Color3.new(1,1,1)
            nLabel.TextXAlignment = Enum.TextXAlignment.Left
            nLabel.Font = Enum.Font.GothamSemibold
            nLabel.TextSize = 14
            
            local kBtn = Instance.new("TextButton", frame)
            kBtn.Size = UDim2.new(0.4, 0, 0.8, 0)
            kBtn.Position = UDim2.new(0.6, 0, 0.1, 0)
            kBtn.BackgroundColor3 = Color3.fromRGB(30,30,30)
            kBtn.Text = "[" .. UserSettings.Keybinds[keyName].Name .. "]"
            kBtn.TextColor3 = Color3.fromRGB(255, 255, 0)
            kBtn.Font = Enum.Font.GothamBold
            kBtn.TextSize = 14
            
            Instance.new("UICorner", kBtn).CornerRadius = UDim.new(0, 6)
            local stroke = Instance.new("UIStroke", kBtn)
            stroke.Color = Color3.fromRGB(255,0,0)
            stroke.Thickness = 1
            
            keybindButtons[keyName] = kBtn
            
            kBtn.Activated:Connect(function()
                kBtn.Text = "[...]"
                local connection
                connection = UserInputService.InputBegan:Connect(function(input)
                    if input.UserInputType == Enum.UserInputType.Keyboard then
                        if input.KeyCode ~= Enum.KeyCode.Unknown and input.KeyCode ~= Enum.KeyCode.Escape then
                            UserSettings.Keybinds[keyName] = input.KeyCode
                            kBtn.Text = "[" .. input.KeyCode.Name .. "]"
                            
                            connection:Disconnect()
                            StarterGui:SetCore("SendNotification", {Title="Keybind Set"; Text=name.." set to "..input.KeyCode.Name; Duration=1;})
                        end
                    end
                end)
            end)
        end
        createRebindButton("Boost", "Boost")
        createRebindButton("Chaos Snap", "Snap")
        createRebindButton("Chaos Control", "Control")
        createRebindButton("Chaos Spear", "Spear")
        createRebindButton("Chaos Blast", "Blast")
        createRebindButton("Dark Execution", "Execution")
        
        adjBtn.Activated:Connect(function()
            isAdjustingControls = true
            sFrame.Visible = false 
            
            local originalPos = {}
            if mobileBtn then originalPos["mobile"] = mobileBtn.Position end
            if cbMobileBtn then originalPos["cb"] = cbMobileBtn.Position end
            if tpBtn then originalPos["tp"] = tpBtn.Position end
            if dashBtn then originalPos["dash"] = dashBtn.Position end
            
            local adjustBar = Instance.new("Frame", settingsGui)
            adjustBar.Name = "AdjustTopBar"
            adjustBar.Size = UDim2.new(0.6, 0, 0, 50)
            adjustBar.Position = UDim2.new(0.2, 0, 0, 10)
            adjustBar.BackgroundColor3 = Color3.fromRGB(0,0,0)
            adjustBar.BackgroundTransparency = 0.3
            Instance.new("UICorner", adjustBar).CornerRadius = UDim.new(0, 8)
            Instance.new("UIStroke", adjustBar).Color = Color3.new(1,0,0)
            
            local layout = Instance.new("UIListLayout", adjustBar)
            layout.FillDirection = Enum.FillDirection.Horizontal
            layout.Padding = UDim.new(0, 10)
            layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
            layout.VerticalAlignment = Enum.VerticalAlignment.Center
            
            local function makeAdjBtn(text, color, func)
                local b = Instance.new("TextButton", adjustBar)
                b.Text = text
                b.Size = UDim2.new(0, 100, 0, 35)
                b.BackgroundColor3 = color
                b.TextColor3 = Color3.new(1,1,1)
                b.Font = Enum.Font.GothamBold
                Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6)
                b.Activated:Connect(func)
                return b
            end
            
            if mobileBtn then mobileBtn.Visible = true end
            if cbMobileBtn then cbMobileBtn.Visible = true end
            if tpBtn then 
                tpBtn.Visible = true 
                screenGui.Enabled = true 
            end
            if dashBtn then 
                dashBtn.Visible = true 
                screenGui.Enabled = true 
            end
            
            local connections = {}
            local function bindDrag(btn)
                if not btn then return end
                local dragStart, startPos
                local dragging = false
                
                local inputBegan = btn.InputBegan:Connect(function(input)
                    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
                        dragging = true
                        dragStart = input.Position
                        startPos = btn.Position
                        
                        input.Changed:Connect(function()
                            if input.UserInputState == Enum.UserInputState.End then dragging = false end
                        end)
                    end
                end)
                
                local inputChanged = UserInputService.InputChanged:Connect(function(input)
                    if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
                        local delta = input.Position - dragStart
                        btn.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
                    end
                end)
                
                table.insert(connections, inputBegan)
                table.insert(connections, inputChanged)
            end
            
            bindDrag(mobileBtn)
            bindDrag(cbMobileBtn)
            bindDrag(tpBtn)
            bindDrag(dashBtn)
            
            local function exitAdjust()
                isAdjustingControls = false
                adjustBar:Destroy()
                sFrame.Visible = true
                
                for _, c in pairs(connections) do c:Disconnect() end
                
                if tpBtn then tpBtn.Visible = false end
                if dashBtn then dashBtn.Visible = false end
                screenGui.Enabled = false
            end
            
            makeAdjBtn("SAVE", Color3.fromRGB(0, 150, 0), function()
                SaveSettings()
                exitAdjust()
            end)
            
            makeAdjBtn("DEFAULT", Color3.fromRGB(80, 80, 80), function()
                local confirmFrame = Instance.new("Frame", settingsGui)
                confirmFrame.Size = UDim2.new(0, 250, 0, 120)
                confirmFrame.Position = UDim2.new(0.5, -125, 0.5, -60)
                confirmFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
                confirmFrame.BorderSizePixel = 0
                Instance.new("UICorner", confirmFrame)
                Instance.new("UIStroke", confirmFrame).Color = Color3.new(1,0,0)
                
                local cLabel = Instance.new("TextLabel", confirmFrame)
                cLabel.Size = UDim2.new(1,0,0.5,0)
                cLabel.BackgroundTransparency = 1
                cLabel.Text = "Are you sure you want to reset controls?"
                cLabel.TextColor3 = Color3.new(1,1,1)
                cLabel.TextWrapped = true
                cLabel.Font = Enum.Font.GothamBold
                cLabel.TextSize = 16
                
                local yesBtn = Instance.new("TextButton", confirmFrame)
                yesBtn.Size = UDim2.new(0.4, 0, 0, 30)
                yesBtn.Position = UDim2.new(0.05, 0, 0.6, 0)
                yesBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0)
                yesBtn.Text = "YES"
                yesBtn.TextColor3 = Color3.new(1,1,1)
                Instance.new("UICorner", yesBtn)
                
                local noBtn = Instance.new("TextButton", confirmFrame)
                noBtn.Size = UDim2.new(0.4, 0, 0, 30)
                noBtn.Position = UDim2.new(0.55, 0, 0.6, 0)
                noBtn.BackgroundColor3 = Color3.fromRGB(150, 0, 0)
                noBtn.Text = "NO"
                noBtn.TextColor3 = Color3.new(1,1,1)
                Instance.new("UICorner", noBtn)
                
                noBtn.Activated:Connect(function() confirmFrame:Destroy() end)
                yesBtn.Activated:Connect(function()
                    if mobileBtn then mobileBtn.Position = UDim2.new(1, -150, 1, -120) end
                    if cbMobileBtn then cbMobileBtn.Position = UDim2.new(1, -100, 0, 50) end
                    if tpBtn then tpBtn.Position = UDim2.new(1, -180, 0.5, -75) end
                    if dashBtn then dashBtn.Position = UDim2.new(1, -180, 0.5, -75) end
                    confirmFrame:Destroy()
                end)
            end)
            
            makeAdjBtn("DONT SAVE", Color3.fromRGB(150, 0, 0), function()
                if mobileBtn and originalPos["mobile"] then mobileBtn.Position = originalPos["mobile"] end
                if cbMobileBtn and originalPos["cb"] then cbMobileBtn.Position = originalPos["cb"] end
                if tpBtn and originalPos["tp"] then tpBtn.Position = originalPos["tp"] end
                if dashBtn and originalPos["dash"] then dashBtn.Position = originalPos["dash"] end
                exitAdjust()
            end)
            
        end)
    end
    createSettingsMenu()
    -- // DISABLE DEFAULT ROBLOX ANIMATIONS //
    local defaultAnimate = character:FindFirstChild("Animate")
    if defaultAnimate then
        defaultAnimate.Disabled = true
    end
    for _, track in pairs(animator:GetPlayingAnimationTracks()) do
        track:Stop()
    end
    -- // CONFIGURATION //
    local BASE_SPEED = 16
    local MAX_SPEED = 110
    local ACCELERATION = 0.6
    local DECELERATION = 1.2
    local BOOST_MAX_SPEED = 350
    local BOOST_ACCEL = 3.5
    local MAX_FUEL = 100
    local FUEL_DRAIN_RATE = 5
    local FUEL_REGEN_RATE = 6
    local REGEN_DELAY = 6
    local isBoosting = false
    local mobileBoostActive = false
    local currentFuel = MAX_FUEL
    local lastBoostInputTime = 0
    local wasBoosting = false
    local isChaosMode = false 
    local CHAOS_MODE_DRAIN = 1.5 
    local chaosHighlight = nil 
    local chaosModeLight = nil 
    local boostStartShake = 0        
    local SHAKE_DECAY = 40             
    local RING_MESH_ID = "rbxassetid://3270017"
    local BOOST_RING_INTERVAL = 0.5
    local lastRingTime = 0
    local FOV_BASE = 65
    local FOV_MAX_ADD = 15
    local RUN_THRESHOLD = 45
    local BOOST_FOV_INSTANT = 120
    local MAX_JUMP_HEIGHT = 20
    local MIN_JUMP_FACTOR = 0.35
    local DOUBLE_JUMP_POWER = 60
    local SKYDIVE_DELAY = 3
    local SKYDIVE_GLIDE_SPEED = 50
    local SKYDIVE_FAST_SPEED = 100 
    local SKYDIVE_TRAIL_COLOR = ColorSequence.new(Color3.fromRGB(255, 255, 255))
    local GHOST_SPEED_THRESHOLD = 70
    local GHOST_INTERVAL = 0.08
    local GHOST_LIFETIME = 0.4
    local GHOST_START_TRANSPARENCY = 0.4
    local GHOST_COLOR = Color3.fromRGB(255, 130, 0) 
    local CHAOS_SNAP_COLOR = Color3.fromRGB(0, 255, 255)
    local BOOST_GHOST_COLOR = Color3.fromRGB(255, 0, 0) 
    local CHAOS_SNAP_COOLDOWN = 10
    local CHAOS_CONTROL_COOLDOWN = 35
    local CHAOS_SPEAR_COOLDOWN = 2.5
    local CHAOS_BLAST_COOLDOWN = 60 
    local lastControlTime = 0
    local lastSpearTime = 0
    local lastBlastTime = 0
    local TRAIL_SPEED_THRESHOLD = 60
    local TRAIL_LIFETIME = 0.3
    local TRAIL_COLOR = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 200, 50)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 100, 0))
    }
    local BOOST_TRAIL_COLOR = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 140, 0)),  
        ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 80, 0))     
    }
    local CHAOS_TRAIL_COLOR = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(150, 0, 0))
    }
    -- // ANIMATION IDS //
    local WALK_ID = "rbxassetid://118959209918644"
    local RUN_ID = "rbxassetid://82598234841035"
    local JUMP_FALL_ID = "rbxassetid://119889021060156"
    local IDLE_ID = "rbxassetid://94185268120378"
    local SKYDIVE_ID = "rbxassetid://125379786496551"
    local FAST_FALL_ID = "rbxassetid://70951390614197" 
    local CHAOS_CONTROL_ID = "rbxassetid://101023140381662"
    local BOOST_ANIM_ID = "rbxassetid://97249689010021"
    local SPEAR_THROW_ANIM_ID = "rbxassetid://85280045192208"
    local CHAOS_TRANSFORM_ID = "rbxassetid://10478338114"
    local TRUE_SPEED_ATTACK_ID = "rbxassetid://106790674785958" 
    local CHAOS_EXECUTION_ID = "rbxassetid://113281566861349" 
    local CHAOS_BLAST_ANIM_ID = "rbxassetid://132846696697494"
    -- // SOUND IDS //
    local TELEPORT_SOUND_ID = "rbxassetid://108199974348386"
    local ORB_HOLD_SOUND_ID = "rbxassetid://116878923270833"
    local RUN_SOUND_ID = "rbxassetid://7642558936"
    local JUMP_SOUND_ID = "rbxassetid://157631498"
    local DOUBLE_JUMP_SOUND_ID = "rbxassetid://4320636235"
    local SKYDIVE_SOUND_ID = "rbxassetid://9056932358"
    local SPEAR_SOUND_ID = "rbxassetid://112412567107872"
    local CHARGE_2SEC_SOUND_ID = "rbxassetid://123121220995984"
    local EXPLOSION_SOUND_ID = "rbxassetid://142070127" 
    local BOUNCE_SOUND_ID = "rbxassetid://5434058126" 
    local TS_FINAL_BOOM_ID = "rbxassetid://6324690450"
    local IMPACT_FRAME_SOUND = "rbxassetid://7641734415"
    local FINAL_BLOW_SOUND = "rbxassetid://5677173879"
    local CHAOS_BLAST_CHARGE_SOUND = "rbxassetid://108181158632948" 
    local CHAOS_BLAST_EXPLODE_SOUND = "rbxassetid://80024435867181" 
    local CHAOS_NUKE_SOUND = "rbxassetid://92631715509459" 
    local CHAOS_TRANSFORM_SOUND = "rbxassetid://134675240339758" 
    local DARK_EXECUTION_SOUND = "rbxassetid://123583601781109"
    local BOOST_LAYER_1 = "rbxassetid://100151140683608"
    local BOOST_LAYER_2 = "rbxassetid://124077240848615"
    local BOOST_LOOP_ID = "rbxassetid://100031000096655"
    -- // SOUND SETUP //
    local runSound = Instance.new("Sound")
    runSound.Name = "RunningSound"
    runSound.SoundId = RUN_SOUND_ID
    runSound.Looped = true
    runSound.Volume = 1.5
    runSound.Parent = rootPart
    local skydiveSound = Instance.new("Sound")
    skydiveSound.Name = "SkydiveSound"
    skydiveSound.SoundId = SKYDIVE_SOUND_ID
    skydiveSound.Looped = true
    skydiveSound.Volume = 2
    skydiveSound.Parent = rootPart
    local boostSfx1 = Instance.new("Sound")
    boostSfx1.Name = "BoostLayer1"
    boostSfx1.SoundId = BOOST_LAYER_1
    boostSfx1.Volume = 2
    boostSfx1.Parent = rootPart
    local boostSfx2 = Instance.new("Sound")
    boostSfx2.Name = "BoostLayer2"
    boostSfx2.SoundId = BOOST_LAYER_2
    boostSfx2.Volume = 2
    boostSfx2.Parent = rootPart
    local boostLoopSfx = Instance.new("Sound")
    boostLoopSfx.Name = "BoostLoop"
    boostLoopSfx.SoundId = BOOST_LOOP_ID
    boostLoopSfx.Looped = true
    boostLoopSfx.Volume = 2
    boostLoopSfx.Parent = rootPart
    -- // VISUAL EFFECTS //
    local highlight = Instance.new("Highlight")
    highlight.Name = "JumpHighlight"
    highlight.FillColor = Color3.fromRGB(255, 100, 0)
    highlight.OutlineTransparency = 1
    highlight.FillTransparency = 0.4
    highlight.Enabled = false
    highlight.Parent = character
    local glowLight = Instance.new("PointLight")
    glowLight.Name = "JumpLight"
    glowLight.Color = Color3.fromRGB(255, 120, 0)
    glowLight.Range = 16
    glowLight.Brightness = 3
    glowLight.Enabled = false
    glowLight.Parent = rootPart
    local chargeHighlight = Instance.new("Highlight")
    chargeHighlight.Name = "SpearChargeHighlight"
    chargeHighlight.FillColor = Color3.fromRGB(255, 100, 0)
    chargeHighlight.OutlineTransparency = 1
    chargeHighlight.FillTransparency = 1
    chargeHighlight.Enabled = false
    chargeHighlight.Parent = character
    local chargeLight = Instance.new("PointLight")
    chargeLight.Name = "SpearChargeLight"
    chargeLight.Color = Color3.fromRGB(255, 100, 0)
    chargeLight.Range = 0
    chargeLight.Brightness = 0
    chargeLight.Enabled = false
    chargeLight.Parent = rootPart
    local rFootLight = nil
    local lFootLight = nil
    local function applyBoostHudStyle(button, cornerRadius)
        button.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
        button.BackgroundTransparency = 0.2
        button.TextColor3 = Color3.fromRGB(255, 255, 255)
        
        local corner = button:FindFirstChildOfClass("UICorner") or Instance.new("UICorner", button)
        corner.CornerRadius = cornerRadius or UDim.new(0, 8)
        
        local stroke = button:FindFirstChildOfClass("UIStroke") or Instance.new("UIStroke", button)
        stroke.Thickness = 2
        stroke.Color = Color3.fromRGB(255, 0, 0)
        stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
    end
    tpBtn = Instance.new("TextButton")
    tpBtn.Name = "TeleportBtn"
    tpBtn.Size = UDim2.new(0, 150, 0, 150)
    if UserSettings.ButtonPositions["TeleportBtn"] then
        local pos = UserSettings.ButtonPositions["TeleportBtn"]
        tpBtn.Position = UDim2.new(pos.X, pos.XO, pos.Y, pos.YO)
    else
        tpBtn.Position = UDim2.new(1, -180, 0.5, -75)
    end
    tpBtn.Text = "SNAP!"
    tpBtn.Font = Enum.Font.FredokaOne
    tpBtn.TextSize = 30
    tpBtn.Visible = false 
    applyBoostHudStyle(tpBtn, UDim.new(1, 0)) 
    tpBtn.Parent = screenGui
    dashBtn = Instance.new("TextButton")
    dashBtn.Name = "DashBtn"
    dashBtn.Size = UDim2.new(0, 150, 0, 150)
    if UserSettings.ButtonPositions["DashBtn"] then
        local pos = UserSettings.ButtonPositions["DashBtn"]
        dashBtn.Position = UDim2.new(pos.X, pos.XO, pos.Y, pos.YO)
    else
        dashBtn.Position = UDim2.new(1, -180, 0.5, -75)
    end
    dashBtn.Text = "DASH!"
    dashBtn.Font = Enum.Font.FredokaOne
    dashBtn.TextSize = 30
    dashBtn.Visible = false 
    applyBoostHudStyle(dashBtn, UDim.new(1, 0)) 
    dashBtn.Parent = screenGui
    local boostFrame = Instance.new("Frame")
    boostFrame.Name = "BoostContainer"
    boostFrame.Size = UDim2.new(0, 200, 0, 60)
    boostFrame.Position = UDim2.new(0, 20, 0, 20)
    boostFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    boostFrame.BackgroundTransparency = 0.2
    boostFrame.Parent = hudGui
    local hudCorner = Instance.new("UICorner")
    hudCorner.CornerRadius = UDim.new(0, 8)
    hudCorner.Parent = boostFrame
    local hudStroke = Instance.new("UIStroke")
    hudStroke.Thickness = 2
    hudStroke.Color = Color3.fromRGB(255, 0, 0)
    hudStroke.Parent = boostFrame
    local boostLabel = Instance.new("TextLabel")
    boostLabel.Size = UDim2.new(1, -20, 0.6, 0)
    boostLabel.Position = UDim2.new(0, 10, 0, 0)
    boostLabel.BackgroundTransparency = 1
    boostLabel.Text = "BOOST"
    boostLabel.Font = Enum.Font.FredokaOne
    boostLabel.TextSize = 32
    boostLabel.TextXAlignment = Enum.TextXAlignment.Left
    boostLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    boostLabel.Parent = boostFrame
    local labelGradient = Instance.new("UIGradient")
    labelGradient.Color = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 140, 0))
    }
    labelGradient.Parent = boostLabel
    local keyHint = Instance.new("TextLabel")
    keyHint.Size = UDim2.new(0, 50, 0, 20)
    keyHint.Position = UDim2.new(1, -55, 0, 12)
    keyHint.BackgroundTransparency = 1
    keyHint.Text = "[SHIFT]"
    keyHint.Font = Enum.Font.GothamBold
    keyHint.TextSize = 14
    keyHint.TextColor3 = Color3.fromRGB(180, 50, 50)
    keyHint.Parent = boostFrame
    local barBg = Instance.new("Frame")
    barBg.Size = UDim2.new(1, -20, 0, 8)
    barBg.Position = UDim2.new(0, 10, 0.7, 0)
    barBg.BackgroundColor3 = Color3.fromRGB(30, 0, 0)
    barBg.Parent = boostFrame
    local barCorner = Instance.new("UICorner")
    barCorner.CornerRadius = UDim.new(1, 0)
    barCorner.Parent = barBg
    local barFill = Instance.new("Frame")
    barFill.Name = "Fill"
    barFill.Size = UDim2.new(1, 0, 1, 0)
    barFill.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    barFill.BorderSizePixel = 0
    barFill.Parent = barBg
    local fillCorner = Instance.new("UICorner")
    fillCorner.CornerRadius = UDim.new(1, 0)
    fillCorner.Parent = barFill
    local fillGradient = Instance.new("UIGradient")
    fillGradient.Color = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 165, 0))
    }
    fillGradient.Parent = barFill
    chaosMeterFrame = Instance.new("Frame")
    chaosMeterFrame.Name = "ChaosMeterContainer"
    chaosMeterFrame.Size = UDim2.new(0, 200, 0, 24) 
    chaosMeterFrame.Position = UDim2.new(0, 20, 0, 90)
    chaosMeterFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) 
    chaosMeterFrame.BackgroundTransparency = 0.2 
    chaosMeterFrame.Parent = hudGui
    local chaosCorner = Instance.new("UICorner")
    chaosCorner.CornerRadius = UDim.new(0, 8) 
    chaosCorner.Parent = chaosMeterFrame
    local chaosStroke = Instance.new("UIStroke")
    chaosStroke.Thickness = 2 
    chaosStroke.Color = Color3.fromRGB(255, 0, 0) 
    chaosStroke.Parent = chaosMeterFrame
    chaosStroke.Transparency = 0 
    local chaosLabel = Instance.new("TextLabel")
    chaosLabel.Size = UDim2.new(1, 0, 1, 0)
    chaosLabel.Position = UDim2.new(0, 0, 0, 0)
    chaosLabel.BackgroundTransparency = 1
    chaosLabel.Text = "CHAOS BOOST"
    chaosLabel.Font = Enum.Font.FredokaOne
    chaosLabel.TextSize = 16 
    chaosLabel.ZIndex = 2
    chaosLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    chaosLabel.TextStrokeTransparency = 1 
    chaosLabel.TextTransparency = 1 
    chaosLabel.Parent = chaosMeterFrame
    pressFLabel = Instance.new("TextLabel")
    pressFLabel.Name = "PressFLabel"
    pressFLabel.Size = UDim2.new(1, 0, 1, 0)
    pressFLabel.Position = UDim2.new(0, 0, -1, 0)
    pressFLabel.BackgroundTransparency = 1
    pressFLabel.Text = "PRESS [F]"
    pressFLabel.Font = Enum.Font.FredokaOne
    pressFLabel.TextSize = 20
    pressFLabel.ZIndex = 2
    pressFLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
    pressFLabel.TextStrokeColor3 = Color3.fromRGB(255, 0, 0)
    pressFLabel.TextStrokeTransparency = 0
    pressFLabel.Visible = false
    pressFLabel.Parent = chaosMeterFrame
    task.spawn(function()
        while pressFLabel do
            if pressFLabel.Visible then
                pressFLabel.TextTransparency = 0
                pressFLabel.TextStrokeTransparency = 0
                task.wait(0.5)
                pressFLabel.TextTransparency = 0.5
                pressFLabel.TextStrokeTransparency = 0.5
                task.wait(0.5)
            else
                task.wait(1)
            end
        end
    end)
    local chaosBarBg = Instance.new("Frame")
    chaosBarBg.Size = UDim2.new(1, -4, 0, 8) 
    chaosBarBg.Position = UDim2.new(0, 2, 0.5, -4) 
    chaosBarBg.BackgroundColor3 = Color3.fromRGB(20, 0, 0)
    chaosBarBg.ZIndex = 0
    chaosBarBg.Parent = chaosMeterFrame
    chaosBarBg.BackgroundTransparency = 1 
    local cBarCorner = Instance.new("UICorner")
    cBarCorner.CornerRadius = UDim.new(0, 2)
    cBarCorner.Parent = chaosBarBg
    chaosBarFill = Instance.new("Frame")
    chaosBarFill.Name = "ChaosFill"
    chaosBarFill.Size = UDim2.new(0, 0, 1, 0) 
    chaosBarFill.BackgroundColor3 = Color3.fromRGB(255, 255, 255) 
    chaosBarFill.BorderSizePixel = 0
    chaosBarFill.ZIndex = 1
    chaosBarFill.Parent = chaosBarBg
    chaosBarFill.BackgroundTransparency = 1 
    local cFillCorner = Instance.new("UICorner")
    cFillCorner.CornerRadius = UDim.new(0, 2)
    cFillCorner.Parent = chaosBarFill
    local chaosGradient = Instance.new("UIGradient")
    chaosGradient.Color = ColorSequence.new{
        ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 165, 0)), 
        ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 255, 0))  
    }
    chaosGradient.Parent = chaosBarFill
    cbMobileBtn = Instance.new("TextButton")
    cbMobileBtn.Name = "ChaosBoostBtn"
    cbMobileBtn.Size = UDim2.new(0, 80, 0, 80)
    if UserSettings.ButtonPositions["ChaosBoostBtn"] then
        local pos = UserSettings.ButtonPositions["ChaosBoostBtn"]
        cbMobileBtn.Position = UDim2.new(pos.X, pos.XO, pos.Y, pos.YO)
    else
        cbMobileBtn.Position = UDim2.new(1, -100, 0, 50)
    end
    cbMobileBtn.Text = "CB"
    cbMobileBtn.Font = Enum.Font.FredokaOne
    cbMobileBtn.TextSize = 36
    cbMobileBtn.Visible = false 
    applyBoostHudStyle(cbMobileBtn, UDim.new(1, 0))
    cbMobileBtn.Parent = hudGui
    local function pulseCBButton()
    end
    pulseCBButton()
    local FADE_TIME = 0.3 
    local VISIBLE_TIME = 2.0 
    local chaosLabelFadeOut = TweenService:Create(chaosLabel, TweenInfo.new(FADE_TIME), {TextTransparency = 1, TextStrokeTransparency = 1})
    local chaosLabelFadeIn = TweenService:Create(chaosLabel, TweenInfo.new(FADE_TIME), {TextTransparency = 0, TextStrokeTransparency = 0.5})
    local meterFadeInTween = TweenService:Create(chaosMeterFrame, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 0.2}) 
    local meterFadeOutTween = TweenService:Create(chaosMeterFrame, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 1})
    local strokeFadeInTween = TweenService:Create(chaosStroke, TweenInfo.new(FADE_TIME), {Transparency = 0})
    local strokeFadeOutTween = TweenService:Create(chaosStroke, TweenInfo.new(FADE_TIME), {Transparency = 1})
    local barBgFadeInTween = TweenService:Create(chaosBarBg, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 0})
    local barBgFadeOutTween = TweenService:Create(chaosBarBg, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 1})
    local barFillFadeInTween = TweenService:Create(chaosBarFill, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 0})
    local barFillFadeOutTween = TweenService:Create(chaosBarFill, TweenInfo.new(FADE_TIME), {BackgroundTransparency = 1})
    local meterTimeout = nil
    updateChaosMeterVisibility = function(fade)
        if isChaosMode then fade = "in" end
        if chaosMeter >= MAX_CHAOS_METER then fade = "in" end
        if fade == "in" then
            if meterTimeout then task.cancel(meterTimeout) meterTimeout = nil end
            meterFadeOutTween:Cancel()
            strokeFadeOutTween:Cancel()
            barBgFadeOutTween:Cancel()
            chaosLabelFadeOut:Cancel()
            barFillFadeOutTween:Cancel() 
            meterFadeInTween:Play()
            strokeFadeInTween:Play()
            barBgFadeInTween:Play()
            chaosLabelFadeIn:Play()
            barFillFadeInTween:Play()
            
            if not isChaosMode and chaosMeter = MAX_CHAOS_METER and not isChaosMode then
            if UserInputService.TouchEnabled then
                cbMobileBtn.Visible = true
            end
        else
            cbMobileBtn.Visible = false
        end
    end
    local function addChaosMeter(amount)
        if isChaosMode then return end 
        chaosMeter = math.clamp(chaosMeter + amount, 0, MAX_CHAOS_METER)
        chaosBarFill:TweenSize(UDim2.new(chaosMeter/MAX_CHAOS_METER, 0, 1, 0), "Out", "Quad", 0.1, true) 
        
        if chaosMeter >= MAX_CHAOS_METER then
            pressFLabel.Visible = true
            if meterTimeout then task.cancel(meterTimeout) meterTimeout = nil end
        else
            pressFLabel.Visible = false
        end
        
        updateChaosMeterVisibility("in")
        updateCBButtonVisibility()
    end
    mobileBtn = Instance.new("TextButton")
    mobileBtn.Name = "MobileBoostBtn"
    mobileBtn.Size = UDim2.new(0, 60, 0, 60)
    if UserSettings.ButtonPositions["MobileBoostBtn"] then
        local pos = UserSettings.ButtonPositions["MobileBoostBtn"]
        mobileBtn.Position = UDim2.new(pos.X, pos.XO, pos.Y, pos.YO)
    else
        mobileBtn.Position = UDim2.new(1, -150, 1, -120)
    end
    mobileBtn.Text = "BST"
    mobileBtn.Font = Enum.Font.FredokaOne
    mobileBtn.TextSize = 24
    mobileBtn.AutoButtonColor = true
    applyBoostHudStyle(mobileBtn, UDim.new(1, 0))
    mobileBtn.Parent = hudGui
    if not UserInputService.TouchEnabled then
        mobileBtn.Visible = false
    end
    mobileBtn.Activated:Connect(function()
        if isAdjustingControls then return end 
        mobileBoostActive = not mobileBoostActive
        if mobileBoostActive then
            mobileBtn.BackgroundColor3 = Color3.fromRGB(255, 50, 0) 
            mobileBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
        else
            mobileBtn.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
            mobileBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
        end
    end)
    local aimTargetModel = Instance.new("Model")
    aimTargetModel.Name = "AimTarget"
    aimTargetModel.Parent = nil
    local function createTrail(limbName, color, lifetime)
        local limb = character:FindFirstChild(limbName)
        if not limb then
            if limbName == "LeftFoot" then limb = character:FindFirstChild("Left Leg") end
            if limbName == "RightFoot" then limb = character:FindFirstChild("Right Leg") end
            if limbName == "LeftHand" then limb = character:FindFirstChild("Left Arm") end
            if limbName == "RightHand" then limb = character:FindFirstChild("Right Arm") end
        end
        if not limb then return nil end  
        local att0 = Instance.new("Attachment", limb)  
        att0.Position = Vector3.new(0, -0.2, 0)  
        local att1 = Instance.new("Attachment", limb)  
        att1.Position = Vector3.new(0, 0.2, 0)  
        local trail = Instance.new("Trail")  
        trail.Parent = limb  
        trail.Attachment0 = att0  
        trail.Attachment1 = att1  
        trail.FaceCamera = true  
        trail.Lifetime = lifetime  
        trail.Color = color  
        trail.Transparency = NumberSequence.new({  
            NumberSequenceKeypoint.new(0, 0.4),  
            NumberSequenceKeypoint.new(1, 1)  
        })  
        trail.Enabled = false   
        return trail
    end
    local runTrailL = createTrail("LeftFoot", TRAIL_COLOR, TRAIL_LIFETIME)
    local runTrailR = createTrail("RightFoot", TRAIL_COLOR, TRAIL_LIFETIME)
    local diveTrailLF = createTrail("LeftFoot", SKYDIVE_TRAIL_COLOR, 0.5)
    local diveTrailRF = createTrail("RightFoot", SKYDIVE_TRAIL_COLOR, 0.5)
    local diveTrailLH = createTrail("LeftHand", SKYDIVE_TRAIL_COLOR, 0.5)
    local diveTrailRH = createTrail("RightHand", SKYDIVE_TRAIL_COLOR, 0.5)
    local skydiveTrails = {diveTrailLF, diveTrailRF, diveTrailLH, diveTrailRH}
    local function spawnGhost(overrideColor, overridePos)
        local ghostModel = Instance.new("Model")
        ghostModel.Name = "SpeedGhost"
        local colorToUse = overrideColor or GHOST_COLOR  
        for _, part in pairs(character:GetChildren()) do  
            if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" and part.Transparency < 1 then  
                local ghostPart = part:Clone()  
                ghostPart.Parent = ghostModel  
                ghostPart.Anchored = true  
                ghostPart.CanCollide = false  
                ghostPart.Massless = true  
                if overridePos then  
                    local offset = rootPart.CFrame:Inverse() * part.CFrame  
                    ghostPart.CFrame = overridePos * offset  
                else  
                    ghostPart.CFrame = part.CFrame  
                end  
                ghostPart.Material = Enum.Material.Neon  
                ghostPart.Color = colorToUse  
                ghostPart.Transparency = GHOST_START_TRANSPARENCY  
                for _, child in pairs(ghostPart:GetChildren()) do  
                    if child:IsA("Decal") or child:IsA("Texture") or child:IsA("SpecialMesh") == false then  
                        child:Destroy()  
                    end  
                end  
                local tweenInfo = TweenInfo.new(GHOST_LIFETIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)  
                local tween = TweenService:Create(ghostPart, tweenInfo, {Transparency = 1})  
                tween:Play()  
            end  
        end  
        ghostModel.Parent = workspace.CurrentCamera  
        Debris:AddItem(ghostModel, GHOST_LIFETIME + 0.1)
    end
    local function spawnBoostRing()
        local ring = Instance.new("Part")
        ring.Name = "BoostRing"
        ring.Anchored = true
        ring.CanCollide = false
        ring.Material = Enum.Material.Neon 
        
        local ringColor = Color3.fromRGB(255, 120, 20) 
        local startScale = Vector3.new(8, 8, 3)
        local endScale = Vector3.new(22, 22, 1)
        
        if isChaosMode then
            ringColor = Color3.fromRGB(255, 0, 0) 
            startScale = Vector3.new(20, 20, 5)   
            endScale = Vector3.new(50, 50, 1)        
        end
        
        ring.Color = ringColor
        ring.Transparency = 0
        ring.Size = Vector3.new(0.1, 0.1, 0.1)
        ring.Parent = workspace
        ring.CFrame = rootPart.CFrame * CFrame.Angles(math.rad(180), math.rad(0), 0)  
        local mesh = Instance.new("SpecialMesh")  
        mesh.MeshId = RING_MESH_ID  
        mesh.Parent = ring  
        mesh.Scale = startScale 
        local light = Instance.new("PointLight", ring)  
        light.Color = ring.Color  
        light.Range = 25  
        light.Brightness = 4  
        local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)  
        local meshGoal = {Scale = endScale}   
        local tMesh = TweenService:Create(mesh, tInfo, meshGoal)  
        tMesh:Play()  
        local partGoal = {Transparency = 1}  
        local tPart = TweenService:Create(ring, tInfo, partGoal)  
        tPart:Play()  
        Debris:AddItem(ring, 0.5)
    end
    local function spawnShockwave(pos)
        local wave = Instance.new("Part")
        wave.Anchored = true
        wave.CanCollide = false
        wave.Shape = Enum.PartType.Cylinder
        wave.Material = Enum.Material.Neon
        wave.Color = CHAOS_SNAP_COLOR
        wave.Size = Vector3.new(1, 5, 5)
        wave.CFrame = CFrame.new(pos) * CFrame.Angles(0,0,math.rad(90))
        wave.Parent = workspace
        local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out)  
        local tSize = TweenService:Create(wave, tInfo, {Size = Vector3.new(1, 40, 40), Transparency = 1})  
        tSize:Play()  
        Debris:AddItem(wave, 0.5)
    end
    local function loadAnim(id, priority)
        local anim = Instance.new("Animation")
        anim.AnimationId = id
        local track = animator:LoadAnimation(anim)
        track.Priority = priority
        return track
    end
    local walkTrack = loadAnim(WALK_ID, Enum.AnimationPriority.Movement)
    local runTrack = loadAnim(RUN_ID, Enum.AnimationPriority.Action)
    local jumpTrack = loadAnim(JUMP_FALL_ID, Enum.AnimationPriority.Action)
    local idleTrack = loadAnim(IDLE_ID, Enum.AnimationPriority.Movement)
    local skydiveTrack = loadAnim(SKYDIVE_ID, Enum.AnimationPriority.Action)
    local fastFallTrack = loadAnim(FAST_FALL_ID, Enum.AnimationPriority.Action) 
    local controlTrack = loadAnim(CHAOS_CONTROL_ID, Enum.AnimationPriority.Action)
    local boostTrack = loadAnim(BOOST_ANIM_ID, Enum.AnimationPriority.Action)
    local spearThrowTrack = loadAnim(SPEAR_THROW_ANIM_ID, Enum.AnimationPriority.Action)
    local chaosTransformTrack = loadAnim(CHAOS_TRANSFORM_ID, Enum.AnimationPriority.Action)
    local trueSpeedAttackTrack = loadAnim(TRUE_SPEED_ATTACK_ID, Enum.AnimationPriority.Action) 
    local chaosExecutionTrack = loadAnim(CHAOS_EXECUTION_ID, Enum.AnimationPriority.Action) 
    local chaosBlastTrack = loadAnim(CHAOS_BLAST_ANIM_ID, Enum.AnimationPriority.Action) 
    humanoid.UseJumpPower = false
    humanoid.JumpHeight = MAX_JUMP_HEIGHT
    -- // VARIABLES //
    local currentSpeed = BASE_SPEED
    local hasDoubleJumped = false
    local lastJumpTime = 0
    local lastGhostTime = 0
    local fallStartTime = nil
    -- // CHAOS SNAP VARIABLES //
    local isAiming = false
    local aimClone = nil
    local aimPosition = Vector3.new(0,0,0)
    local AIM_CAM_OFFSET = Vector3.new(0, 5, 12)
    local lastSnapTime = 0 
    -- // CHAOS CONTROL VARIABLES //
    local isChaosControlActive = false
    local controlOrb = nil
    local controlSound = nil
    local pendingChaosDamage = {} 
    local pendingExplosions = {} 
    local activeChaosBubblePos = nil 
    local raycastParams = RaycastParams.new()
    raycastParams.FilterType = Enum.RaycastFilterType.Exclude
    raycastParams.FilterDescendantsInstances = {character, aimTargetModel}
    local function applyChaosDamage(hum, amount)
        if not hum or not hum.Parent then return end
        if Players:GetPlayerFromCharacter(hum.Parent) then return end
        
        if not hum.RootPart then hum:TakeDamage(amount) return end
        
        if activeChaosBubblePos then
            local dist = (hum.RootPart.Position - activeChaosBubblePos).Magnitude
            local checkRad = 45
            if isChaosMode then checkRad = 450 end
            if dist  0 and not Players:GetPlayerFromCharacter(obj.Parent) then
                local targetRoot = obj.Parent:FindFirstChild("HumanoidRootPart")
                if targetRoot then
                    local distance = (targetRoot.Position - rootPart.Position).Magnitude
                    if distance <= EXPLOSION_RADIUS then
                        obj:TakeDamage(obj.MaxHealth)
                    end
                end
            end
        end
    end
    local function spawnAmbientChaosOrb()
        if not rootPart or not isChaosMode then return end
        
        local spawnRadius = 40 
        local offset = Vector3.new(math.random(-spawnRadius, spawnRadius), math.random(-10, 5), math.random(-spawnRadius, spawnRadius))
        local spawnPos = rootPart.Position + offset
        local orb = Instance.new("Part")
        orb.Shape = Enum.PartType.Ball
        orb.Material = Enum.Material.Neon
        orb.Color = Color3.fromRGB(255, 0, 0)
        local sizeScale = math.random(5, 15) / 10 
        orb.Size = Vector3.new(sizeScale, sizeScale, sizeScale)
        
        orb.CFrame = CFrame.new(spawnPos)
        orb.Anchored = true
        orb.CanCollide = false
        orb.Transparency = 1 
        orb.Parent = workspace
        local lifetime = 3 
        local floatHeight = 50 
        local t1Info = TweenInfo.new(lifetime / 2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
        local t1Goal = {Transparency = 0.3, CFrame = orb.CFrame * CFrame.new(0, floatHeight/2, 0)}
        local t1 = TweenService:Create(orb, t1Info, t1Goal)
        local t2Info = TweenInfo.new(lifetime / 2, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
        local t2Goal = {Transparency = 1, CFrame = orb.CFrame * CFrame.new(0, floatHeight, 0)}
        local t2 = TweenService:Create(orb, t2Info, t2Goal)
        t1:Play()
        t1.Completed:Connect(function()
            if orb and orb.Parent then t2:Play() end
        end)
        Debris:AddItem(orb, lifetime + 0.1)
    end
    local function activateChaosMode()
        if isChaosMode then return end
        if isAdjustingControls then return end
        if chaosMeter  0 and chaosTransformTrack.Length or 2.5
        task.wait(waitTime)
        
        rootPart.Anchored = false
        humanoid.WalkSpeed = BASE_SPEED 
        humanoid.JumpHeight = MAX_JUMP_HEIGHT
        
        local sfx = Instance.new("Sound", rootPart)
        sfx.SoundId = "rbxassetid://108199974348386"
        sfx.Volume = 2
        sfx:Play()
        Debris:AddItem(sfx, 3)
        
        createChaosExplosion()
        
        task.spawn(function()
            while isChaosMode and character and character.Parent do
                local orbCount = math.random(0)
                for i = 1, orbCount do
                    spawnAmbientChaosOrb()
                end
                task.wait(math.random(2, 6)/10) 
            end
        end)
    end
    local function deactivateChaosMode()
        isChaosMode = false
        chaosTransformTrack:Stop()
        updateChaosMeterVisibility("out") 
        
        if chaosHighlight then 
            chaosHighlight:Destroy() 
            chaosHighlight = nil 
        end
        if chaosModeLight then
            chaosModeLight:Destroy()
            chaosModeLight = nil
        end
    
        -- // NEW: REMOVE TORSO MESH LOGIC //
        if chaosTorsoModel then
            chaosTorsoModel:Destroy()
            chaosTorsoModel = nil
        end
    end
    cbMobileBtn.Activated:Connect(activateChaosMode)
    local function ChaosControlStart()
        if isAdjustingControls then return end
        isChaosControlActive = true
        currentSpeed = 0
        humanoid.WalkSpeed = 0
        controlTrack:Play(0.2)  
        controlSound = Instance.new("Sound")  
        controlSound.SoundId = ORB_HOLD_SOUND_ID  
        controlSound.Looped = true  
        controlSound.Volume = 2  
        controlSound.RollOffMaxDistance = 10000   
        controlSound.Parent = rootPart  
        controlSound:Play()  
        local targetHand = nil  
        local orbOffset = CFrame.new(0,0,0)  
        if humanoid.RigType == Enum.HumanoidRigType.R15 then  
            targetHand = character:FindFirstChild("LeftHand")  
            orbOffset = CFrame.new(0, -0.1, 0)   
        elseif humanoid.RigType == Enum.HumanoidRigType.R6 then  
            targetHand = character:FindFirstChild("Left Arm")  
            orbOffset = CFrame.new(0, -1, 0)   
        end  
        if targetHand then  
            controlOrb = Instance.new("Part")  
            controlOrb.Size = Vector3.new(0.8, 0.8, 0.8)  
            controlOrb.Shape = Enum.PartType.Ball  
            controlOrb.Material = Enum.Material.Neon  
            controlOrb.Color = Color3.fromRGB(50, 255, 50)   
            controlOrb.Transparency = 0.2  
            controlOrb.CanCollide = false  
            controlOrb.Massless = true  
            controlOrb.Parent = character  
            controlOrb.CFrame = targetHand.CFrame * orbOffset  
            local weld = Instance.new("WeldConstraint")  
            weld.Part0 = targetHand  
            weld.Part1 = controlOrb  
            weld.Parent = controlOrb  
        end
    end
    local function ChaosControlEnd()
        isChaosControlActive = false
        controlTrack:Stop(0.2)
        if controlOrb then  
            controlOrb:Destroy()  
            controlOrb = nil  
        end  
        if controlSound then  
            controlSound:Stop()  
            controlSound:Destroy()  
            controlSound = nil  
        end
    end
    controlTool.Equipped:Connect(ChaosControlStart)
    controlTool.Unequipped:Connect(ChaosControlEnd)
    local function ActivateChaosBlast()
        if isAdjustingControls then return end
        local now = tick()
        local timeLeft = CHAOS_BLAST_COOLDOWN - (now - lastBlastTime)
        
        if timeLeft > 0 and not isChaosMode and not cheat_NoCooldown then
            StarterGui:SetCore("SendNotification", {
                Title = "Cooldown";
                Text = "Chaos Blast ready in: " .. math.ceil(timeLeft) .. "s";  
                Duration = 1;
            })
            return
        end
        
        if isChaosMode and timeLeft > 0 and not cheat_NoCooldown then
            StarterGui:SetCore("SendNotification", {
                Title = "Cooldown";
                Text = "Chaos Blast ready in: " .. math.ceil(timeLeft) .. "s";  
                Duration = 1;
            })
            return
        end
        
        lastBlastTime = now
        
        if isChaosMode then
            humanoid.WalkSpeed = 0
            rootPart.Anchored = true
            chaosBlastTrack:Play()
            
            local originalCamType = camera.CameraType
            if UserSettings.AbilityCutscenes then
                camera.CameraType = Enum.CameraType.Scriptable
                local cutsceneCF = rootPart.CFrame * CFrame.new(0, 5, -15) * CFrame.Angles(0, math.rad(180), 0)
                TweenService:Create(camera, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {CFrame = cutsceneCF}):Play()
            end
            
            local cBlastHighlight = Instance.new("Highlight")
            cBlastHighlight.Name = "ChaosBlastChargeHL"
            cBlastHighlight.FillColor = Color3.fromRGB(255, 0, 0) 
            cBlastHighlight.OutlineTransparency = 1 
            cBlastHighlight.FillTransparency = 1 
            cBlastHighlight.Parent = character
            
            local cBlastLight = Instance.new("PointLight")
            cBlastLight.Name = "ChaosBlastChargeLight"
            cBlastLight.Color = Color3.fromRGB(255, 0, 0) 
            cBlastLight.Range = 30
            cBlastLight.Brightness = 0 
            cBlastLight.Parent = rootPart
            
            TweenService:Create(cBlastHighlight, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {FillTransparency = 0}):Play()
            TweenService:Create(cBlastLight, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Brightness = 10}):Play()
            
            local chargeSfx = Instance.new("Sound", rootPart)
            chargeSfx.SoundId = CHAOS_BLAST_CHARGE_SOUND
            chargeSfx.Volume = 1
            chargeSfx:Play()
            Debris:AddItem(chargeSfx, 4)
            
            local chargeStart = tick()
            task.spawn(function()
                while tick() - chargeStart < 3 do
                    if not rootPart then break end
                    local orb = Instance.new("Part")
                    orb.Shape = Enum.PartType.Ball
                    orb.Material = Enum.Material.Neon
                    orb.Color = Color3.fromRGB(255, 0, 0)
                    orb.Size = Vector3.new(0.5, 0.5, 0.5)
                    orb.Anchored = true
                    orb.CanCollide = false
                    local offset = Vector3.new(math.random(-25, 25), math.random(-10, 20), math.random(-25, 25))
                    orb.CFrame = CFrame.new(rootPart.Position + offset)
                    orb.Parent = workspace
                    local tInfo = TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
                    local tween = TweenService:Create(orb, tInfo, {CFrame = rootPart.CFrame, Transparency = 1})
                    tween:Play()
                    Debris:AddItem(orb, 0.4)
                    task.wait(0.05) 
                end
            end)
            
            task.wait(3)
            
            camera.CameraType = originalCamType
            
            rootPart.Anchored = false
            humanoid.WalkSpeed = BASE_SPEED
            chaosBlastTrack:Stop()
            
            local nukeSfx = Instance.new("Sound", rootPart)
            nukeSfx.SoundId = CHAOS_NUKE_SOUND
            nukeSfx.Volume = 5
            nukeSfx:Play()
            Debris:AddItem(nukeSfx, 6)
            
            TweenService:Create(cBlastHighlight, TweenInfo.new(0.5), {FillTransparency = 1}):Play()
            TweenService:Create(cBlastLight, TweenInfo.new(0.5), {Brightness = 0}):Play()
            Debris:AddItem(cBlastHighlight, 0.5)
            Debris:AddItem(cBlastLight, 0.5)
            
            local nuke = Instance.new("Part")
            nuke.Shape = Enum.PartType.Ball
            nuke.Material = Enum.Material.Neon
            nuke.Color = Color3.fromRGB(255, 50, 0)
            nuke.Size = Vector3.new(10,10,10)
            nuke.CFrame = rootPart.CFrame
            nuke.Anchored = true
            nuke.CanCollide = false
            nuke.Parent = workspace
            
            TweenService:Create(nuke, TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = Vector3.new(500, 500, 500), Transparency = 1}):Play()
            Debris:AddItem(nuke, 5.1)
            
            local explosionStart = tick()
            local hitCache = {} 
            local params = OverlapParams.new()
            params.FilterDescendantsInstances = {character}
            
            task.spawn(function()
                while tick() - explosionStart  0 and not hitCache[hum] then
                            if not Players:GetPlayerFromCharacter(model) then 
                                hitCache[hum] = true
                                hum:TakeDamage(hum.MaxHealth + 999999)
                                if root then
                                    local bv = Instance.new("BodyVelocity")
                                    bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
                                    local dir = (root.Position - rootPart.Position).Unit
                                    bv.Velocity = dir * 200 + Vector3.new(0, 100, 0)
                                    bv.Parent = root
                                    Debris:AddItem(bv, 0.5)
                                end
                            end
                        end
                    end
                    
                    RunService.RenderStepped:Wait()
                end
                humanoid.CameraOffset = Vector3.new(0,0,0)
            end)
            
        else
            humanoid.WalkSpeed = 0 
            rootPart.Anchored = true
            
            chaosBlastTrack:Play() 
            
            local originalCamType = camera.CameraType
            if UserSettings.AbilityCutscenes then
                camera.CameraType = Enum.CameraType.Scriptable
                local cutsceneCF = rootPart.CFrame * CFrame.new(0, 5, -15) * CFrame.Angles(0, math.rad(180), 0)
                TweenService:Create(camera, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {CFrame = cutsceneCF}):Play()
            end
            
            local chargeSfx = Instance.new("Sound", rootPart)
            chargeSfx.SoundId = CHAOS_BLAST_CHARGE_SOUND
            chargeSfx.Volume = 1
            chargeSfx:Play()
            Debris:AddItem(chargeSfx, 4)
            
            local cBlastHighlight = Instance.new("Highlight")
            cBlastHighlight.Name = "ChaosBlastChargeHL"
            cBlastHighlight.FillColor = Color3.fromRGB(255, 140, 0) 
            cBlastHighlight.OutlineTransparency = 1 
            cBlastHighlight.FillTransparency = 1 
            cBlastHighlight.Parent = character
            
            local cBlastLight = Instance.new("PointLight")
            cBlastLight.Name = "ChaosBlastChargeLight"
            cBlastLight.Color = Color3.fromRGB(255, 120, 0)
            cBlastLight.Range = 30
            cBlastLight.Brightness = 0 
            cBlastLight.Parent = rootPart
            
            TweenService:Create(cBlastHighlight, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {FillTransparency = 0}):Play()
            TweenService:Create(cBlastLight, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Brightness = 10}):Play()
            
            local chargeStart = tick()
            task.spawn(function()
                while tick() - chargeStart < 3 do
                    if not rootPart then break end
                    
                    local orb = Instance.new("Part")
                    orb.Shape = Enum.PartType.Ball
                    orb.Material = Enum.Material.Neon
                    orb.Color = Color3.fromRGB(255, 100, 0)
                    orb.Size = Vector3.new(0.5, 0.5, 0.5)
                    orb.Anchored = true
                    orb.CanCollide = false
                    
                    local offset = Vector3.new(
                        math.random(-25, 25),
                        math.random(-10, 20),
                        math.random(-25, 25)
                    )
                    orb.CFrame = CFrame.new(rootPart.Position + offset)
                    orb.Parent = workspace
                    
                    local tInfo = TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
                    local tween = TweenService:Create(orb, tInfo, {CFrame = rootPart.CFrame, Transparency = 1})
                    tween:Play()
                    Debris:AddItem(orb, 0.4)
                    
                    task.wait(0.05) 
                end
            end)
            
            task.wait(3)
            
            if not rootPart or not rootPart.Parent then 
                cBlastHighlight:Destroy()
                cBlastLight:Destroy()
                camera.CameraType = originalCamType
                return 
            end
            
            camera.CameraType = originalCamType
            
            chaosBlastTrack:Stop()
            rootPart.Anchored = false
            humanoid.WalkSpeed = BASE_SPEED
            
            addChaosMeter(25)
            
            TweenService:Create(cBlastHighlight, TweenInfo.new(0.5), {FillTransparency = 1}):Play()
            TweenService:Create(cBlastLight, TweenInfo.new(0.5), {Brightness = 0}):Play()
            Debris:AddItem(cBlastHighlight, 0.5)
            Debris:AddItem(cBlastLight, 0.5)
            
            local blast = Instance.new("Part")
            blast.Shape = Enum.PartType.Ball
            blast.Material = Enum.Material.Neon
            blast.Color = Color3.fromRGB(255, 100, 0) 
            blast.Size = Vector3.new(5,5,5)
            blast.CFrame = rootPart.CFrame
            blast.Anchored = true
            blast.CanCollide = false
            blast.Parent = workspace
            
            TweenService:Create(blast, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = Vector3.new(200, 200, 200), Transparency = 1}):Play()
            Debris:AddItem(blast, 0.5)
            
            local boomSfx = Instance.new("Sound", rootPart)
            boomSfx.SoundId = CHAOS_BLAST_EXPLODE_SOUND
            boomSfx.Volume = 5
            boomSfx:Play()
            Debris:AddItem(boomSfx, 4)
            
            task.spawn(function()
                local shakeStart = tick()
                while tick() - shakeStart  0 and not hitHumanoids[hum] then
                    if Players:GetPlayerFromCharacter(model) then continue end 
                    
                    hitHumanoids[hum] = true
                    applyChaosDamage(hum, hum.MaxHealth * 0.50) 
                    
                    local bv = Instance.new("BodyVelocity")
                    bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
                    local dir = (root.Position - rootPart.Position).Unit
                    bv.Velocity = dir * 150 + Vector3.new(0, 50, 0)
                    bv.Parent = root
                    Debris:AddItem(bv, 0.3)
                end
            end
        end
    end
    blastTool.Activated:Connect(ActivateChaosBlast)
    local function toggleAimMode()
        if isAdjustingControls then return end
        isAiming = not isAiming
        if isAiming then  
            local timeLeft = CHAOS_SNAP_COOLDOWN - (tick() - lastSnapTime)  
            if timeLeft > 0 and not isChaosMode and not cheat_NoCooldown then  
                isAiming = false   
                StarterGui:SetCore("SendNotification", {  
                    Title = "Cooldown";  
                    Text = "Chaos Snap ready in: " .. math.ceil(timeLeft) .. "s";  
                    Duration = 1;  
                })  
                return  
            end  
            screenGui.Enabled = true  
            tpBtn.Visible = true 
            
            aimPosition = rootPart.Position
            
            if aimClone then aimClone:Destroy() end
            character.Archivable = true
            aimClone = character:Clone()
            character.Archivable = false
            aimClone.Name = "ChaosSnapVisual"
            
            for _, v in pairs(aimClone:GetDescendants()) do
                if v:IsA("Script") or v:IsA("LocalScript") or v:IsA("Sound") then v:Destroy() end
                if v:IsA("BasePart") then
                    v.Material = Enum.Material.Neon
                    v.Color = CHAOS_SNAP_COLOR
                    v.Transparency = 0.4
                    v.CanCollide = false
                    v.Anchored = true
                end
            end
            aimClone.Parent = aimTargetModel
            aimTargetModel.Parent = workspace  
            
            humanoid.WalkSpeed = 0   
            currentSpeed = 0
            humanoid.PlatformStand = true 
            rootPart.Anchored = true 
            
            if aimClone:FindFirstChild("Humanoid") then
                camera.CameraSubject = aimClone.Humanoid
            end
        else  
            screenGui.Enabled = false  
            tpBtn.Visible = false
            if aimClone then aimClone:Destroy() end
            aimTargetModel.Parent = nil  
            
            camera.CameraSubject = humanoid 
            camera.CameraType = Enum.CameraType.Custom  
            humanoid.WalkSpeed = BASE_SPEED  
            humanoid.PlatformStand = false
            rootPart.Anchored = false 
        end
    end
    local function performTeleport()
        if not isAiming then return end
        if isAdjustingControls then return end
        lastSnapTime = tick()  
        local startCF = rootPart.CFrame  
        spawnGhost(CHAOS_SNAP_COLOR, startCF)  
        local targetPos = aimPosition 
        rootPart.CFrame = CFrame.new(targetPos, targetPos + aimClone.HumanoidRootPart.CFrame.LookVector)  
        
        humanoid.PlatformStand = false
        rootPart.AssemblyLinearVelocity = Vector3.zero
        spawnShockwave(aimPosition)  
        addChaosMeter(6)  
        toggleAimMode()  
        local sfx = Instance.new("Sound", rootPart)  
        sfx.SoundId = TELEPORT_SOUND_ID   
        sfx.Volume = 3  
        sfx.RollOffMaxDistance = 10000   
        sfx:Play()  
        Debris:AddItem(sfx, 3)
    end
    chaosTool.Activated:Connect(function()
        if not isAiming then
            toggleAimMode()
        end
    end)
    tpBtn.Activated:Connect(performTeleport)
    local isTrueSpeedAiming = false
    local isTrueSpeedAttacking = false 
    local speedLine = nil
    local function toggleTrueSpeedAim()
        if isAdjustingControls then return end
        isTrueSpeedAiming = not isTrueSpeedAiming
        if isTrueSpeedAiming then
            humanoid.WalkSpeed = 0
            humanoid.JumpHeight = 0 
            currentSpeed = 0
            
            local bv = Instance.new("BodyVelocity")
            bv.Name = "ImmobileConstraint"
            bv.MaxForce = Vector3.new(1e9, 0, 1e9) 
            bv.Velocity = Vector3.new(0, 0, 0)
            bv.Parent = rootPart
            
            speedLine = Instance.new("Part")
            speedLine.Name = "TrueSpeedLine"
            speedLine.Size = Vector3.new(1, 0.2, 100) 
            speedLine.Anchored = true
            speedLine.CanCollide = false
            speedLine.Material = Enum.Material.Neon
            speedLine.Color = Color3.fromRGB(255, 140, 0) 
            speedLine.Parent = workspace
            
            screenGui.Enabled = true
            dashBtn.Visible = true
            tpBtn.Visible = false
        else
            humanoid.WalkSpeed = BASE_SPEED
            humanoid.JumpHeight = MAX_JUMP_HEIGHT
            
            local bv = rootPart:FindFirstChild("ImmobileConstraint")
            if bv then bv:Destroy() end
            
            if speedLine then
                speedLine:Destroy()
                speedLine = nil
            end
            
            screenGui.Enabled = false
            dashBtn.Visible = false
        end
    end
    local function performTrueSpeedDash()
        if not isTrueSpeedAiming then return end
        if isAdjustingControls then return end
        
        if currentFuel  0 then
                    if not Players:GetPlayerFromCharacter(model) then
                        hitEnemy = true
                        enemyRoot = root
                        enemyHum = hum
                    end
                end
            end
        end
        
        toggleTrueSpeedAim()
        
        if hitEnemy and enemyRoot then
            addChaosMeter(3)
            
            if isChaosMode then
                isTrueSpeedAttacking = true
                
                chaosExecutionTrack:Play()
                chaosExecutionTrack:AdjustSpeed(6)
                
                spawnGhost(Color3.fromRGB(0, 255, 255), rootPart.CFrame)
                
                rootPart.CFrame = enemyRoot.CFrame * CFrame.new(0, 0, 3)
                
                -- // DARK EXECUTION CUTSCENE (HORIZONTAL SIDE VIEW) //
                local originalCamType = camera.CameraType
                if UserSettings.AbilityCutscenes then
                    camera.CameraType = Enum.CameraType.Scriptable
                    -- // FIXED: HORIZONTAL SIDE VIEW CAMERA //
                    local midPoint = rootPart.Position:Lerp(enemyRoot.Position, 0.5)
                    local sideOffset = (rootPart.CFrame.RightVector * 15) + Vector3.new(0, 0, 0)
                    -- LookAt creates a horizontal view if Y is balanced, but we just want a clean side shot
                    camera.CFrame = CFrame.lookAt(midPoint + sideOffset, midPoint)
                    -- // -------------------------------- //
                end
                -- //
                
                local cc = Instance.new("ColorCorrectionEffect")
                cc.Name = "InvertImpact"
                cc.Contrast = 2
                cc.Saturation = -1
                cc.Brightness = 0.1
                cc.Parent = Lighting
                
                rootPart.Anchored = true
                enemyRoot.Anchored = true
                
                task.wait(0.6)
                
                -- // RESET CAMERA //
                camera.CameraType = originalCamType
                -- //
                
                cc:Destroy()
                
                enemyRoot.Anchored = false
                rootPart.Anchored = false
                isTrueSpeedAttacking = false
                
                local boomSfx = Instance.new("Sound", rootPart)
                boomSfx.SoundId = FINAL_BLOW_SOUND
                boomSfx.Volume = 5
                boomSfx:Play()
                Debris:AddItem(boomSfx, 2)
                
                local impactSfx = Instance.new("Sound", rootPart)
                impactSfx.SoundId = IMPACT_FRAME_SOUND
                impactSfx.Volume = 3
                impactSfx:Play()
                Debris:AddItem(impactSfx, 2)
                
                local bv = Instance.new("BodyVelocity")
                bv.MaxForce = Vector3.new(1e9, 1e9, 1e9)
                bv.Velocity = rootPart.CFrame.LookVector * 150
                bv.Parent = enemyRoot
                Debris:AddItem(bv, 0.5)
                
                enemyHum:TakeDamage(enemyHum.MaxHealth + 99999)
                
                local shakeStart = tick()
                local shakeDuration = 0.5 
                
                task.spawn(function()
                    while tick() - shakeStart < shakeDuration do
                        local shakeAmt = 1.5
                        humanoid.CameraOffset = Vector3.new(
                            math.random(-1,1) * shakeAmt,
                            math.random(-1,1) * shakeAmt,
                            math.random(-1,1) * shakeAmt
                        )
                        RunService.RenderStepped:Wait()
                    end
                    humanoid.CameraOffset = Vector3.new(0,0,0)
                end)
                
                local boom = Instance.new("Part")
                boom.Shape = Enum.PartType.Ball
                boom.Material = Enum.Material.Neon
                boom.Color = Color3.fromRGB(0, 255, 255) 
                boom.Size = Vector3.new(1,1,1)
                boom.CFrame = enemyRoot.CFrame
                boom.Anchored = true
                boom.CanCollide = false
                boom.Parent = workspace
                TweenService:Create(boom, TweenInfo.new(0.5), {Size = Vector3.new(30,30,30), Transparency = 1}):Play()
                Debris:AddItem(boom, 0.5)
                
            else
                local originalAnchor = enemyRoot.Anchored
                enemyRoot.Anchored = true
                
                local directionToEnemy = (enemyRoot.Position - rootPart.Position).Unit
                local attackPosition = enemyRoot.Position - (directionToEnemy * 40)
                attackPosition = Vector3.new(attackPosition.X, enemyRoot.Position.Y + 2, attackPosition.Z)
                
                rootPart.CFrame = CFrame.lookAt(attackPosition, enemyRoot.Position)
                
                local bv = Instance.new("BodyVelocity")
                bv.Name = "AttackFreeze"
                bv.MaxForce = Vector3.new(math.huge, 0, math.huge)
                bv.Velocity = Vector3.new(0, 0, 0)
                bv.Parent = rootPart
                
                isTrueSpeedAttacking = true
                
                if trueSpeedAttackTrack then
                    trueSpeedAttackTrack:Play()
                end
                
                local startTime = tick()
                local barrageDuration = 3
                
                task.spawn(function()
                    while tick() - startTime  0 then
                        local function triggerTrueSpeedFinalBlow()
                            applyChaosDamage(enemyHum, enemyHum.MaxHealth * 0.4) 
                            enemyRoot.Anchored = false 
                            local bvKnock = Instance.new("BodyVelocity")
                            bvKnock.MaxForce = Vector3.new(1e5, 1e5, 1e5)
                            bvKnock.Velocity = rootPart.CFrame.LookVector * 60 
                            bvKnock.Parent = enemyRoot
                            Debris:AddItem(bvKnock, 0.2)
                            
                            local boom = Instance.new("Part")
                            boom.Shape = Enum.PartType.Ball
                            boom.Material = Enum.Material.Neon
                            boom.Color = Color3.fromRGB(255, 100, 0)
                            boom.Size = Vector3.new(1,1,1)
                            boom.CFrame = enemyRoot.CFrame
                            boom.Anchored = true
                            boom.CanCollide = false
                            boom.Parent = workspace
                            TweenService:Create(boom, TweenInfo.new(0.3), {Size = Vector3.new(15,15,15), Transparency = 1}):Play()
                            Debris:AddItem(boom, 0.3)
                            
                            local boomSfx = Instance.new("Sound", boom)
                            boomSfx.SoundId = TS_FINAL_BOOM_ID
                            boomSfx.Volume = 2
                            boomSfx:Play()
                        end
                        
                        local isFrozenInTime = false
                        if activeChaosBubblePos then
                            local dist = (enemyRoot.Position - activeChaosBubblePos).Magnitude
                            if dist  0 then
                if not Players:GetPlayerFromCharacter(obj.Parent) then
                    local root = obj.Parent:FindFirstChild("HumanoidRootPart")
                    if root then
                        local dist = (root.Position - rootPart.Position).Magnitude
                        if dist <= range then
                            table.insert(targets, {Root = root, Dist = dist})
                        end
                    end
                end
            end
        end
        
        table.sort(targets, function(a, b) return a.Dist <b> 0 then  
                if not Players:GetPlayerFromCharacter(obj.Parent) then  
                    local root = obj.Parent:FindFirstChild("HumanoidRootPart")  
                    if root then  
                        local dist = (root.Position - currentPos).Magnitude  
                        if dist  0 then
                local targetIndex = ((i - 1) % #potentialTargets) + 1
                assignedTarget = potentialTargets[targetIndex]
                lookPos = assignedTarget.Position
            end
            spear.CFrame = CFrame.lookAt(spawnPos, lookPos)  
            spear.Parent = workspace  
            local att0 = Instance.new("Attachment", spear)  
            att0.Position = Vector3.new(-0.2, 0, 0) 
            local att1 = Instance.new("Attachment", spear)  
            att1.Position = Vector3.new(0.2, 0, 0)  
            local tColor = ColorSequence.new(Color3.fromRGB(255, 130, 0))
            if isChaosMode then tColor = ColorSequence.new(Color3.fromRGB(255, 0, 0)) end
            local trail = Instance.new("Trail")  
            trail.Parent = spear  
            trail.Attachment0 = att0  
            trail.Attachment1 = att1  
            trail.FaceCamera = true  
            trail.Lifetime = 0.3  
            trail.Color = tColor 
            trail.Transparency = NumberSequence.new({  
                NumberSequenceKeypoint.new(0, 0),  
                NumberSequenceKeypoint.new(1, 1)  
            })  
            trail.Enabled = true  
            table.insert(createdSpears, {Part = spear, Target = assignedTarget})  
        end  
        task.spawn(function()  
            for i, spearData in ipairs(createdSpears) do  
                local spear = spearData.Part
                local specificTarget = spearData.Target
                local life = 4
                
                if not spear or not spear.Parent then continue end  
                if spearCount > 1 then  
                    task.wait(0.15)   
                end  
                spear.Anchored = false  
                local sfx = Instance.new("Sound", spear)  
                sfx.SoundId = SPEAR_SOUND_ID  
                sfx.Volume = 1  
                sfx:Play()  
                local velocity = Instance.new("BodyVelocity")  
                velocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)  
                velocity.Velocity = spear.CFrame.LookVector * 150   
                velocity.Parent = spear  
                local antiGravity = Instance.new("BodyForce")  
                antiGravity.Force = Vector3.new(0, spear:GetMass() * workspace.Gravity, 0)  
                antiGravity.Parent = spear  
                task.spawn(function()  
                    local homingConn  
                    homingConn = RunService.RenderStepped:Connect(function()  
                        if not spear or not spear.Parent then  
                            if homingConn then homingConn:Disconnect() end  
                            return  
                        end  
                        if specificTarget and specificTarget.Parent and specificTarget.Parent:FindFirstChild("Humanoid") and specificTarget.Parent.Humanoid.Health > 0 then  
                            local dir = (specificTarget.Position - spear.Position).Unit  
                            velocity.Velocity = velocity.Velocity:Lerp(dir * 150, 0.15)   
                            spear.CFrame = CFrame.lookAt(spear.Position, specificTarget.Position)  
                        else  
                            if homingConn then homingConn:Disconnect() end  
                        end  
                    end)  
                    spear.Destroying:Connect(function()  
                        if homingConn then homingConn:Disconnect() end  
                    end)  
                end)  
                local hasHit = false  
                local bounces = 0 
                spear.Touched:Connect(function(hit)  
                    if hasHit then return end
                    if hit:IsDescendantOf(character) then return end   
                    if hit.Name == "ChaosSpearProjectile" then return end   
                    
                    local model = hit:FindFirstAncestorOfClass("Model")
                    local targetHum = model and model:FindFirstChild("Humanoid")
                    
                    if model and Players:GetPlayerFromCharacter(model) then return end
                    if isChaosMode and not targetHum then return end
                    if specificTarget and not hit:IsDescendantOf(specificTarget.Parent) and bounces == 0 then return end  
                    if targetHum and targetHum.Health > 0 then
                        applyChaosDamage(targetHum, targetHum.MaxHealth * 0.10)
                        
                        if isChaosMode then
                            if bounces  0 and not hitHumanoids[pHum] then
                                        if not Players:GetPlayerFromCharacter(pModel) then
                                            hitHumanoids[pHum] = true
                                            applyChaosDamage(pHum, pHum.MaxHealth * 0.30)
                                        end
                                    end
                                end
                            end
                        end
                    end
                    hasHit = true  
                    local explosion = Instance.new("Part")  
                    explosion.Shape = Enum.PartType.Ball  
                    explosion.Material = Enum.Material.Neon  
                    explosion.Color = spear.Color  
                    explosion.Size = Vector3.new(1,1,1)  
                    explosion.CFrame = spear.CFrame  
                    explosion.Anchored = true  
                    explosion.CanCollide = false  
                    explosion.Parent = workspace  
                    TweenService:Create(explosion, TweenInfo.new(0.3), {Size = Vector3.new(6,6,6), Transparency = 1}):Play()  
                    Debris:AddItem(explosion, 0.3)  
                    spear:Destroy()  
                end)  
                task.spawn(function()  
                    while life > 0 and spear.Parent do  
                        local dt = RunService.Heartbeat:Wait()  
                        if not spear.Anchored then  
                            life = life - dt  
                        end  
                    end  
                    if spear.Parent then spear:Destroy() end  
                end)  
            end  
        end)
    end
    local isSpearCharging = false
    local chargeStartTime = 0
    local spearInputConnection = nil
    local spearReleaseConnection = nil
    local spearChargeLoop = nil 
    local chargeTweens = {}
    local spearChargeGui = nil 
    local function resetChargeVisuals()
        isSpearCharging = false
        if spearChargeLoop then spearChargeLoop:Disconnect() spearChargeLoop = nil end 
        for _, t in pairs(chargeTweens) do t:Cancel() end
        chargeTweens = {}
        chargeHighlight.FillTransparency = 1  
        chargeHighlight.OutlineTransparency = 1  
        chargeHighlight.Enabled = false  
        chargeLight.Brightness = 0  
        chargeLight.Range = 0  
        chargeLight.Enabled = false
        
        if spearChargeGui then
            spearChargeGui:Destroy()
            spearChargeGui = nil
        end
    end
    local function StartSpearCharge()
        if isAdjustingControls then return end
        if tick() - lastSpearTime  4 then return end
            
            local percentage = math.clamp(math.floor((chargeDuration / 4) * 100), 0, 100)
            if chargeLabel then
                chargeLabel.Text = "Holding charge (" .. percentage .. "%)"
            end
            
            addChaosMeter(1.25 * dt)
        end)
        task.delay(2, function()  
            if isSpearCharging and (tick() - chargeStartTime >= 2) then  
                local sfx = Instance.new("Sound", rootPart)  
                sfx.SoundId = CHARGE_2SEC_SOUND_ID  
                sfx.Volume = 2  
                sfx:Play()  
                Debris:AddItem(sfx, 3)  
            end  
        end)  
        task.delay(4, function()  
            if isSpearCharging and chargeStartTime == thisChargeStart then  
                resetChargeVisuals()  
                fireChaosSpear(10)   
            end  
        end)  
    end
    local function EndSpearCharge()
        if isSpearCharging then  
            local chargeDuration = tick() - chargeStartTime  
            local count = math.clamp(math.floor(chargeDuration * 2.5) + 1, 1, 10)  
            resetChargeVisuals()  
            if humanoid.MoveDirection.Magnitude = MAX_CHAOS_METER and not isChaosMode then
                activateChaosMode()
            end
        end
        
        if UserSettings.PCMode then
            if input.KeyCode == keys.Snap then
                toggleAimMode()
            elseif input.KeyCode == keys.Control then
                local now = tick()
                local timeSince = now - lastControlTime
                local remaining = CHAOS_CONTROL_COOLDOWN - timeSince
                if remaining > 0 and not cheat_NoCooldown then
                    StarterGui:SetCore("SendNotification", {Title = "Chaos Control"; Text = "Ability cooling down: " .. math.ceil(remaining) .. "s remaining"; Duration = 2;})
                else
                    ChaosControlStart()
                    addChaosMeter(12)  
                    lastControlTime = now  
                    spawn(function() pcall(function() runChaosForce() end) end)
                    task.delay(0.5, ChaosControlEnd) 
                end
            elseif input.KeyCode == keys.Spear then
                StartSpearCharge()
            elseif input.KeyCode == keys.Blast then
                ActivateChaosBlast()
            elseif input.KeyCode == keys.Execution then
                toggleTrueSpeedAim()
            end
        end
    end)
    UserInputService.InputEnded:Connect(function(input, gpe)
        if input.KeyCode == UserSettings.Keybinds.Boost then
            isBoosting = false
        end
        
        if UserSettings.PCMode and input.KeyCode == UserSettings.Keybinds.Spear then
            EndSpearCharge()
        end
    end)
    function runChaosForce() 
        local BUBBLE_RADIUS = 45
        if isChaosMode then BUBBLE_RADIUS = 450 end 
        
        local BUBBLE_LIFETIME = 20
        local ANIM_TIME = 1
        local bubble = nil  
        local s3 = nil  
        local hbConn = nil  
        local heartBeatConnection = nil  
        local Folder = nil  
        local frozenParts = {}  
        local isClosing = false  
        local delayedDamageTargets = {}
        local oldWs = humanoid.WalkSpeed  
        local oldJp = humanoid.UseJumpPower and humanoid.JumpPower or humanoid.JumpHeight  
        local soundId1 = "rbxassetid://118873667214385"  
        local soundId2 = "rbxassetid://0"  
        local soundId3 = "rbxassetid://4777634265"  
        ContentProvider:PreloadAsync({soundId1, soundId2, soundId3})  
        local function cleanup()  
            if hbConn then hbConn:Disconnect() hbConn = nil end  
            if bubble and bubble.Parent then bubble:Destroy() bubble = nil end  
            if s3 and s3.Parent then s3:Destroy() s3 = nil end  
    
            -- // NEW: REMOVE STATIC MAP MESH //
            if chaosStaticMapModel then
                chaosStaticMapModel:Destroy()
                chaosStaticMapModel = nil
            end
            
            for hum, dmg in pairs(pendingChaosDamage) do
                if hum and hum.Health > 0 then
                    local root = hum.Parent and hum.Parent:FindFirstChild("HumanoidRootPart")
                    if root then
                        local sfx = Instance.new("Sound", root)
                        sfx.SoundId = "rbxassetid://106790674785958"
                        sfx.Volume = 2
                        sfx:Play()
                        Debris:AddItem(sfx, 1)
                    end
                    hum:TakeDamage(dmg)
                end
            end
            pendingChaosDamage = {} 
            
            for _, explosionFunc in ipairs(pendingExplosions) do
                pcall(function()
                    explosionFunc()
                end)
            end
            pendingExplosions = {} 
            
            activeChaosBubblePos = nil 
            for part,_ in pairs(frozenParts) do  
                if part and part.Parent then  
                    pcall(function()  
                        part.Anchored = false  
                    end)  
                end  
            end  
            frozenParts = {}
            delayedDamageTargets = {} 
            if heartBeatConnection then heartBeatConnection:Disconnect() heartBeatConnection = nil end  
            if Folder and Folder.Parent then Folder:Destroy() Folder = nil end  
            if getgenv and getgenv().Network then   
                getgenv().Network = nil   
            end  
            camera.CameraType = Enum.CameraType.Custom  
            humanoid.WalkSpeed = oldWs  
            if humanoid.UseJumpPower then  
                humanoid.JumpPower = oldJp  
            else  
                humanoid.JumpHeight = oldJp  
            end  
        end  
        local function playCutscene()  
            humanoid.WalkSpeed = 0  
            if humanoid.UseJumpPower then  
                humanoid.JumpPower = 0  
            else  
                humanoid.JumpHeight = 0  
            end  
            camera.CameraType = Enum.CameraType.Scriptable  
            local startCFrame = rootPart.CFrame * CFrame.new(0, 0, -8) * CFrame.Angles(0, math.rad(180), 0)  
            camera.CFrame = CFrame.lookAt(startCFrame.Position, rootPart.Position + Vector3.new(0, 2, 0))  
            local endCFrame = rootPart.CFrame * CFrame.new(5, 5, -12) * CFrame.Angles(0, math.rad(160), 0)  
            local targetLookAt = CFrame.lookAt(endCFrame.Position, rootPart.Position)  
            local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)  
            local tween = TweenService:Create(camera, info, {CFrame = targetLookAt})  
            tween:Play()  
            tween.Completed:Wait()  
            camera.CameraType = Enum.CameraType.Custom  
            humanoid.WalkSpeed = oldWs  
            if humanoid.UseJumpPower then  
                humanoid.JumpPower = oldJp  
            else  
                humanoid.JumpHeight = oldJp  
            end  
        end  
        local function createBubble(color, position)  
            local b = Instance.new("Part")  
            b.Shape = Enum.PartType.Ball  
            b.Size = Vector3.new(0, 0, 0)   
            b.Transparency = 1   
            b.Material = Enum.Material.ForceField  
            b.Color = color  
            b.Anchored = true  
            b.CanCollide = false  
            b.Name = "ChaosBubble"  
            b.CastShadow = false   
            b.CFrame = CFrame.new(position)  
            b.Parent = workspace  
            local targetSize = Vector3.new(BUBBLE_RADIUS * 2, BUBBLE_RADIUS * 2, BUBBLE_RADIUS * 2)  
            local info = TweenInfo.new(ANIM_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) 
            local goal = {Size = targetSize, Transparency = 0.5}  
            local tween = TweenService:Create(b, info, goal)  
            tween:Play()  
            return b  
        end  
        local function closeBubbleSequence()  
            if not bubble then cleanup() return end  
            isClosing = true  
            local info = TweenInfo.new(ANIM_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In)  
            local goal = {Size = Vector3.new(0,0,0), Transparency = 1}  
            local tween = TweenService:Create(bubble, info, goal)  
            tween:Play()  
            
            -- // NEW: FADE OUT STATIC MESH WITH BUBBLE //
            if chaosStaticMapModel then
                for _, descendant in pairs(chaosStaticMapModel:GetDescendants()) do
                    if descendant:IsA("BasePart") or descendant:IsA("MeshPart") then
                        TweenService:Create(descendant, info, {Transparency = 1}):Play()
                    end
                end
            end
    
            tween.Completed:Wait() 
            cleanup()  
        end  
        local function updateFreezeState(b)  
            if not b or isClosing then return end  
            local sphere = Instance.new("Part")  
            sphere.Shape = Enum.PartType.Ball  
            sphere.Size = Vector3.new(BUBBLE_RADIUS * 2, BUBBLE_RADIUS * 2, BUBBLE_RADIUS * 2)  
            sphere.Anchored = true  
            sphere.CanCollide = false  
            sphere.Transparency = 1  
            sphere.CFrame = b.CFrame  
            sphere.CastShadow = false  
            local partsInBubble = workspace:GetPartsInPart(sphere)  
            sphere:Destroy()  
            local ignore = {}  
            for _, plr in ipairs(Players:GetPlayers()) do  
                if plr.Character then  
                    for _, part in ipairs(plr.Character:GetDescendants()) do  
                        if part:IsA("BasePart") then  
                            table.insert(ignore, part)  
                        end  
                    end  
                end  
            end  
            
            for _, part in ipairs(partsInBubble) do  
                if part:IsA("BasePart") and not table.find(ignore, part) and part.Anchored == false then
                    
                    if part.Parent and (part.Parent.Name == "DashGhost" or part.Parent.Name == "SpeedGhost" or part.Parent.Name == "ChaosSnapVisual") then
                        continue 
                    end
                    
                    pcall(function()  
                        part.Anchored = true  
                        frozenParts[part] = true  
                        
                        local model = part.Parent
                        local targetHum = model:FindFirstChild("Humanoid")
                        if targetHum and targetHum.Health > 0 then
                            if not Players:GetPlayerFromCharacter(model) then
                                delayedDamageTargets[targetHum] = true
                            end
                        end
                    end)  
                end  
            end  
            for part, _ in pairs(frozenParts) do  
                if part.Parent == nil then  
                    frozenParts[part] = nil  
                else  
                    local dist = (part.Position - b.Position).Magnitude  
                    if dist > BUBBLE_RADIUS then  
                        pcall(function()  
                            part.Anchored = false  
                        end)  
                        frozenParts[part] = nil  
                    end  
                end  
            end  
        end  
        local s1 = Instance.new("Sound", rootPart)  
        s1.SoundId = soundId1  
        s1.Volume = 1  
        s1:Play()  
        if UserSettings.AbilityCutscenes then
            playCutscene()   
        end
        s1:Destroy()  
        local s2 = Instance.new("Sound", rootPart)  
        s2.SoundId = soundId2  
        s2.Volume = 1  
        s2:Play()  
        Debris:AddItem(s2, 2)  
        local bubblePosition = rootPart.Position + Vector3.new(0,5,0)  
        activeChaosBubblePos = bubblePosition 
        bubble = createBubble(Color3.fromRGB(0,255,0), bubblePosition)  
        
        -- // NEW: SPAWN STATIC MAP MESH INSIDE BUBBLE (WITH LOGIC SWITCH) //
        task.spawn(function()
            local ASSET_ID = "71593058315338" -- Default / Normal mesh
            if isChaosMode then
                ASSET_ID = "137479387459338" -- Chaos Mode mesh (New Request)
            end
            
            local VISIBLE = false    -- Set to true to see it
            local COLLIDABLE = false -- From user snippet
            
            -- Position at bubble center, rotated 180 deg
            local SPAWN_POSITION = bubblePosition
            local FIXED_ROTATION = CFrame.Angles(0, math.rad(180), 0)
            
            print("Spawning mesh as a static map object...")
            local success, result = pcall(function()
               return game:GetObjects("rbxassetid://" .. ASSET_ID)
            end)
            
            if success and result and result[1] then
               local spawnedItem = result[1]
               chaosStaticMapModel = spawnedItem -- Store for removal later
             
               local function configurePart(part)
                   if part:IsA("BasePart") or part:IsA("MeshPart") then
                       part.Transparency = VISIBLE and 0 or 1
                       part.CanCollide = COLLIDABLE
                       part.CanTouch = COLLIDABLE
                       part.CanQuery = COLLIDABLE
                       part.Massless = true
                       part.Anchored = true -- CRITICAL: Must be Anchored to stay static
                   end
               end
            
               for _, child in pairs(spawnedItem:GetDescendants()) do
                   configurePart(child)
               end
               configurePart(spawnedItem)
            
               local finalCFrame = CFrame.new(SPAWN_POSITION) * FIXED_ROTATION
              
               if spawnedItem:IsA("Model") then
                   spawnedItem:PivotTo(finalCFrame)
               elseif spawnedItem:IsA("BasePart") then
                   spawnedItem.CFrame = finalCFrame
               end
            
               spawnedItem.Parent = workspace
               print("SUCCESS: Mesh spawned once inside bubble.")
            else
               warn("FAILED: Could not load ID " .. ASSET_ID)
            end
        end)
        -- // END STATIC MAP MESH LOGIC //
    
        task.delay(BUBBLE_LIFETIME - ANIM_TIME, closeBubbleSequence)  
        s3 = Instance.new("Sound", bubble)  
        s3.SoundId = soundId3  
        s3.Volume = 1  
        s3.Looped = false  
        s3:Play()  
        s3.Ended:Connect(function()  
            if s3 and s3.Parent then s3:Destroy() end  
        end)  
        hbConn = RunService.Heartbeat:Connect(function()  
            if bubble then  
                updateFreezeState(bubble)  
            end  
        end)  
        local function SendChatMessage(message)  
            if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then  
                local textChannel = TextChatService.TextChannels.RBXGeneral  
                if textChannel then textChannel:SendAsync(message) end  
            else  
                local ok, _ = pcall(function()  
                    game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(message, "All")  
                end)  
            end  
        end  
        SendChatMessage("")   
        ChatService:Chat(character, "", Enum.ChatColor.Green)  
        local success, err = pcall(function()  
            Folder = Instance.new("Folder", Workspace)  
            local Part = Instance.new("Part", Folder)  
            local Attachment1 = Instance.new("Attachment", Part)  
            Part.Anchored = true  
            Part.CanCollide = false  
            Part.Transparency = 1  
            if bubble then  
                Part.CFrame = bubble.CFrame   
            else  
                Part.CFrame = rootPart.CFrame  
            end  
            if not getgenv().Network then  
                getgenv().Network = {  
                    BaseParts = {},  
                    Velocity = Vector3.new(14.46262424, 14.46262424, 14.46262424)  
                }  
                local Network = getgenv().Network  
                Network.RetainPart = function(Part)  
                    if typeof(Part) == "Instance" and Part:IsA("BasePart") and Part:IsDescendantOf(Workspace) then  
                        table.insert(Network.BaseParts, Part)  
                        Part.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)  
                        Part.CanCollide = false  
                    end  
                end  
                local function EnablePartControl()  
                    player.ReplicationFocus = Workspace  
                    heartBeatConnection = RunService.Heartbeat:Connect(function()  
                        pcall(function()  
                            sethiddenproperty(player, "SimulationRadius", math.huge)  
                        end)  
                        for _, Part in pairs(Network.BaseParts) do  
                            if Part:IsDescendantOf(Workspace) then  
                                Part.Velocity = Network.Velocity  
                            end  
                        end  
                    end)  
                end  
                EnablePartControl()  
            end  
        end)  
        if not success then  
            warn("[Chaos Force] Physics/Network warning: " .. tostring(err))
        end  
        task.delay(BUBBLE_LIFETIME + 2, function()  
            pcall(cleanup)  
        end)
    end
    controlTool.Activated:Connect(function()
        if isAdjustingControls then return end
        local now = tick()
        local timeSince = now - lastControlTime
        local remaining = CHAOS_CONTROL_COOLDOWN - timeSince
        if remaining > 0 and not cheat_NoCooldown then
            StarterGui:SetCore("SendNotification", {
                Title = "Chaos Control";
                Text = "Ability cooling down: " .. math.ceil(remaining) .. "s remaining";
                Duration = 2;
            })
            return
        end
        addChaosMeter(12)  
        lastControlTime = now  
        spawn(function()  
            pcall(function()  
                runChaosForce()  
            end)  
        end)
    end)
    RunService.RenderStepped:Connect(function(dt)
        if isChaosMode then
            local animIsPlaying = chaosTransformTrack.IsPlaying
            if not animIsPlaying and not cheat_InfiniteChaos then
                chaosMeter = math.clamp(chaosMeter - (CHAOS_MODE_DRAIN * dt), 0, MAX_CHAOS_METER)
                chaosBarFill.Size = UDim2.new(chaosMeter/MAX_CHAOS_METER, 0, 1, 0)
                
                if chaosMeter  0
        
        local fastEnoughForTrails = (currentSpeed > TRAIL_SPEED_THRESHOLD) and isMoving and not (humanoid.FloorMaterial == Enum.Material.Air)
        
        local feetColor = Color3.fromRGB(255, 130, 0) 
        if isChaosMode then
            feetColor = Color3.fromRGB(255, 0, 0) 
        end
        
        local rFoot = character:FindFirstChild("RightFoot") or character:FindFirstChild("Right Leg")
        local lFoot = character:FindFirstChild("LeftFoot") or character:FindFirstChild("Left Leg")
        
        if rFoot and not rFootLight then
            rFootLight = Instance.new("PointLight")
            rFootLight.Name = "FootLightR"
            rFootLight.Range = 6
            rFootLight.Brightness = 2
            rFootLight.Parent = rFoot
        end
        if lFoot and not lFootLight then
            lFootLight = Instance.new("PointLight")
            lFootLight.Name = "FootLightL"
            lFootLight.Range = 6
            lFootLight.Brightness = 2
            lFootLight.Parent = lFoot
        end
        if rFoot and lFoot then
            if fastEnoughForTrails and UserSettings.FeetNeon then
                rFoot.Material = Enum.Material.Neon
                lFoot.Material = Enum.Material.Neon
                
                rFoot.Color = rFoot.Color:Lerp(feetColor, 0.2)
                lFoot.Color = lFoot.Color:Lerp(feetColor, 0.2)
                
                if rFootLight then 
                    rFootLight.Enabled = true 
                    rFootLight.Color = feetColor
                end
                if lFootLight then 
                    lFootLight.Enabled = true 
                    lFootLight.Color = feetColor
                end
            else
                rFoot.Material = Enum.Material.SmoothPlastic
                lFoot.Material = Enum.Material.SmoothPlastic
                
                if rFootLight then rFootLight.Enabled = false end
                if lFootLight then lFootLight.Enabled = false end
            end
        end
        
        if isTrueSpeedAttacking then
            walkTrack:Stop()
            runTrack:Stop()
            idleTrack:Stop()
            jumpTrack:Stop()
            skydiveTrack:Stop()
            controlTrack:Stop()
            boostTrack:Stop()
            
            return
        end
        
        if isTrueSpeedAiming then
            rootPart.AssemblyLinearVelocity = Vector3.zero
            
            local camLook = camera.CFrame.LookVector
            local lookAtPos = rootPart.Position + Vector3.new(camLook.X, 0, camLook.Z)
            rootPart.CFrame = CFrame.lookAt(rootPart.Position, lookAtPos)
            
            -- // FIXED: LINE AIMING (VERTICAL AIM) //
            -- The line now follows exactly where the camera is looking vertically
            if speedLine then
                local startPos = rootPart.Position + Vector3.new(0, -1, 0)
                local lineLook = startPos + (camLook * 100)
                local centerPos = startPos + (camLook * 50)
                speedLine.CFrame = CFrame.lookAt(centerPos, lineLook)
            end
            -- // -------------------------------- //
            
            humanoid.WalkSpeed = 0
            currentSpeed = 0
            if runSound.IsPlaying then runSound:Stop() end
            if skydiveSound.IsPlaying then skydiveSound:Stop() end
            
            return 
        end
        if isChaosControlActive then  
            humanoid.WalkSpeed = 0  
            currentSpeed = 0  
            if runSound.IsPlaying then runSound:Stop() end  
            if skydiveSound.IsPlaying then skydiveSound:Stop() end  
            return   
        end  
        if isAiming then  
            if runSound.IsPlaying then runSound:Stop() end  
            if skydiveSound.IsPlaying then skydiveSound:Stop() end  
            local flySpeed = 120 * dt
            local camCF = camera.CFrame
            local moveDir = humanoid.MoveDirection 
            
            local flyVelocity = Vector3.zero
            if moveDir.Magnitude > 0 then
                
                aimPosition = aimPosition + (moveDir * flySpeed)
                
                if math.abs(moveDir.X) > 0 or math.abs(moveDir.Z) > 0 then
                    local pitch = math.asin(camCF.LookVector.Y)
                    if math.abs(pitch) > 0.1 then
                        local relative = camCF:VectorToObjectSpace(moveDir)
                        if relative.Z  0 then 
                            aimPosition = aimPosition - Vector3.new(0, camCF.LookVector.Y * flySpeed, 0)
                        end
                    end
                end
            end
            if aimClone then
                local lookAt = aimPosition + (camCF.LookVector * 10)
                aimClone:SetPrimaryPartCFrame(CFrame.lookAt(aimPosition, lookAt))
            end
            rootPart.AssemblyLinearVelocity = Vector3.zero
            humanoid.PlatformStand = true
            rootPart.Anchored = true 
            humanoid.WalkSpeed = 0  
            return  
        end  
        local moveDir = humanoid.MoveDirection   
        
        local inAir = humanoid.FloorMaterial == Enum.Material.Air  
        local isSkydiving = false  
        if inAir then  
            if not fallStartTime then fallStartTime = tick() end  
            if (tick() - fallStartTime) > SKYDIVE_DELAY then  
                isSkydiving = true  
            end  
        else  
            fallStartTime = nil  
        end  
        if inAir and not isSkydiving then  
            highlight.Enabled = true  
            glowLight.Enabled = true  
        else  
            highlight.Enabled = false  
            glowLight.Enabled = false  
            hasDoubleJumped = false  
        end  
        local wantsToBoost = (isBoosting or mobileBoostActive)  
        local canBoost = (wantsToBoost and currentFuel > 0 and not isSkydiving)  
        
        if isChaosMode then
            canBoost = wantsToBoost and not isSkydiving 
        end
        if wantsToBoost and not isSkydiving then 
            lastBoostInputTime = tick() 
            if isChaosMode then
                currentFuel = MAX_FUEL 
            elseif currentFuel > 0 and not cheat_InfiniteBoost then  
                currentFuel = currentFuel - (FUEL_DRAIN_RATE * dt)  
            end  
            
            if cheat_InfiniteBoost then currentFuel = MAX_FUEL end
        else  
            if (tick() - lastBoostInputTime) >= REGEN_DELAY then  
                if isMoving then  
                    currentFuel = currentFuel + (FUEL_REGEN_RATE * dt) 
                else  
                    currentFuel = currentFuel + ((FUEL_REGEN_RATE * 2) * dt) 
                end  
            end  
        end  
        currentFuel = math.clamp(currentFuel, 0, MAX_FUEL)  
        barFill.Size = UDim2.new(currentFuel/MAX_FUEL, 0, 1, 0)  
        
        local effectiveMaxSpeed = MAX_SPEED
        local effectiveBoostMax = BOOST_MAX_SPEED
        local effectiveAccel = ACCELERATION
        local effectiveBoostAccel = BOOST_ACCEL
        
        if isChaosMode then
            effectiveMaxSpeed = 200      
            effectiveBoostMax = 450      
            effectiveAccel = 3            
            effectiveBoostAccel = 3.5    
        end
        
        if cheat_InfiniteMomentum then
            effectiveMaxSpeed = 99999
            effectiveBoostMax = 99999
        end
        if isMoving then  
            if canBoost then  
                if currentSpeed  effectiveBoostMax then currentSpeed = effectiveBoostMax end  
                end  
                if tick() - lastRingTime > BOOST_RING_INTERVAL then  
                    lastRingTime = tick()  
                    spawnBoostRing()  
                end  
                if not wasBoosting then  
                    wasBoosting = true  
                    boostStartShake = 12   
                    if not boostSfx1.IsPlaying then boostSfx1:Play() end  
                    if not boostSfx2.IsPlaying then boostSfx2:Play() end  
                    if not boostLoopSfx.IsPlaying then boostLoopSfx:Play() end  
                end  
                boostStartShake = math.max(boostStartShake - (SHAKE_DECAY * dt), 0)  
                local baseShake = 3.5  
                local finalShake = baseShake + boostStartShake  
                humanoid.CameraOffset = Vector3.new(  
                    math.random(-10,10)/100 * finalShake,   
                    math.random(-10,10)/100 * finalShake,   
                    0  
                )  
                
                if UserSettings.BoostFOV then
                    camera.FieldOfView = BOOST_FOV_INSTANT  
                end
                if runSound.IsPlaying then runSound:Stop() end  
            else  
                if currentSpeed  effectiveMaxSpeed then currentSpeed = effectiveMaxSpeed end  
                else  
                    currentSpeed = currentSpeed - DECELERATION  
                end  
                humanoid.CameraOffset = Vector3.new(0,0,0)  
                wasBoosting = false  
                boostStartShake = 0   
                boostSfx1:Stop()  
                boostSfx2:Stop()  
                boostLoopSfx:Stop()  
            end  
        else  
            if UserSettings.MomentumStop == "Rock" then
                currentSpeed = BASE_SPEED
                local oldY = rootPart.AssemblyLinearVelocity.Y
                rootPart.AssemblyLinearVelocity = Vector3.new(0, oldY, 0)
            else
                currentSpeed = math.max(currentSpeed - (DECELERATION * 2), BASE_SPEED)
            end
            
            humanoid.CameraOffset = Vector3.new(0,0,0)  
            wasBoosting = false  
            boostStartShake = 0  
            boostSfx1:Stop()  
            boostSfx2:Stop()  
            boostLoopSfx:Stop()  
        end  
        humanoid.WalkSpeed = currentSpeed  
        if not canBoost and UserSettings.RunFOV then  
            local speedFactor = (currentSpeed - BASE_SPEED) / (effectiveMaxSpeed - BASE_SPEED)  
            local targetFOV = FOV_BASE + (speedFactor * FOV_MAX_ADD)  
            camera.FieldOfView = camera.FieldOfView + (targetFOV - camera.FieldOfView) * 0.1  
        elseif not UserSettings.RunFOV and not UserSettings.BoostFOV then
            camera.FieldOfView = FOV_BASE
        end  
        local fastEnoughForTrails = currentSpeed > TRAIL_SPEED_THRESHOLD and isMoving and not inAir  
        local fastEnoughForGhosts = currentSpeed > GHOST_SPEED_THRESHOLD and isMoving  
        
        if UserSettings.FeetTrail then
            if runTrailL then runTrailL.Enabled = fastEnoughForTrails end  
            if runTrailR then runTrailR.Enabled = fastEnoughForTrails end  
        else
            if runTrailL then runTrailL.Enabled = false end  
            if runTrailR then runTrailR.Enabled = false end 
        end
        if isChaosMode then
            runTrailL.Color = CHAOS_TRAIL_COLOR
            runTrailR.Color = CHAOS_TRAIL_COLOR
        elseif canBoost then  
            runTrailL.Color = BOOST_TRAIL_COLOR  
            runTrailR.Color = BOOST_TRAIL_COLOR  
        else  
            runTrailL.Color = TRAIL_COLOR  
            runTrailR.Color = TRAIL_COLOR  
        end  
        local shouldSpawnGhost = false
        local ghostColorToUse = GHOST_COLOR
        if isChaosMode then
            if currentSpeed > GHOST_SPEED_THRESHOLD and isMoving then
                shouldSpawnGhost = true
                ghostColorToUse = Color3.fromRGB(255, 0, 0)
            end
        else
            if canBoost and isMoving then 
                shouldSpawnGhost = true
                ghostColorToUse = Color3.fromRGB(255, 130, 0) 
            end
        end
        if shouldSpawnGhost and (tick() - lastGhostTime > GHOST_INTERVAL) then  
            if UserSettings.AfterImages then
                lastGhostTime = tick()  
                spawnGhost(ghostColorToUse)   
            end
        end  
        if isSkydiving then  
            if runSound.IsPlaying then runSound:Stop() end  
            if not skydiveSound.IsPlaying then skydiveSound:Play() end  
            local isFastFalling = (isBoosting or mobileBoostActive)
            local diveSpeed = SKYDIVE_GLIDE_SPEED
            
            if isFastFalling then
                diveSpeed = SKYDIVE_FAST_SPEED
                if not fastFallTrack.IsPlaying then
                    skydiveTrack:Stop(0.1)
                    fastFallTrack:Play(0.1)
                end
            else
                if not skydiveTrack.IsPlaying then
                    fastFallTrack:Stop(0.1)
                    skydiveTrack:Play(0.1)
                end
            end
            local vel = rootPart.AssemblyLinearVelocity  
            if vel.Y = RUN_THRESHOLD then  
                    walkTrack:Stop(0.2)  
                    if not runTrack.IsPlaying then runTrack:Play(0.3) end  
                    if runTrack.Speed ~= 0.5 then runTrack:AdjustSpeed(0.5) end  
                    if not runSound.IsPlaying then runSound:Play() end  
                    runSound.PlaybackSpeed = 0.8
                else  
                    runTrack:Stop(0.2)  
                    if not walkTrack.IsPlaying then walkTrack:Play(0.3) end  
                    if runSound.IsPlaying then runSound:Stop() end  
                end  
            end  
        else  
            if runSound.IsPlaying then runSound:Stop() end  
            if skydiveSound.IsPlaying then skydiveSound:Stop() end  
            skydiveTrack:Stop(0.2)  
            fastFallTrack:Stop(0.2)
            jumpTrack:Stop(0.1)  
            runTrack:Stop(0.2)  
            walkTrack:Stop(0.2)  
            controlTrack:Stop(0.1)  
            boostTrack:Stop(0.1)  
            if not idleTrack.IsPlaying then   
                idleTrack:Play(0.2)   
            end  
        end  
        if UserSettings.FeetTrail then
            for _, trail in ipairs(skydiveTrails) do  
                if trail then trail.Enabled = isSkydiving end  
            end
        else
            for _, trail in ipairs(skydiveTrails) do  
                if trail then trail.Enabled = false end  
            end
        end
    end)
    UserInputService.JumpRequest:Connect(function()
        if isAiming or isChaosControlActive or isAdjustingControls then return end
        
        local inAir = humanoid.FloorMaterial == Enum.Material.Air
        local isSkydiving = false
        if inAir then
            if fallStartTime and (tick() - fallStartTime) > SKYDIVE_DELAY then
                isSkydiving = true
            end
        end
        if isSkydiving then return end
        
        if tick() - lastJumpTime < 0.2 then return end
        lastJumpTime = tick()
        if humanoid.FloorMaterial == Enum.Material.Air and not hasDoubleJumped then  
            hasDoubleJumped = true  
            rootPart.AssemblyLinearVelocity = Vector3.new(  
                rootPart.AssemblyLinearVelocity.X,  
                DOUBLE_JUMP_POWER,  
                rootPart.AssemblyLinearVelocity.Z  
            )  
            local sfx = Instance.new("Sound", rootPart)  
            sfx.SoundId = DOUBLE_JUMP_SOUND_ID  
            sfx.Volume = 1.5  
            sfx:Play()  
            Debris:AddItem(sfx, 1.5)  
            local timeSpent = fallStartTime and (tick() - fallStartTime) or 0  
            if timeSpent  0 then
                rootPart.AssemblyLinearVelocity = Vector3.new(
                    rootPart.AssemblyLinearVelocity.X,
                    rootPart.AssemblyLinearVelocity.Y * MIN_JUMP_FACTOR,
                    rootPart.AssemblyLinearVelocity.Z
                )
            end
        end
    end)
    Players.PlayerRemoving:Connect(function(plr)
        if plr == player then
        end
    end)
    humanoid.Died:Connect(function()
        if screenGui then screenGui:Destroy() end
        if hudGui then hudGui:Destroy() end
        if settingsGui then settingsGui:Destroy() end
        if spearChargeGui then spearChargeGui:Destroy() end
        if chaosTool then chaosTool:Destroy() end
        if controlTool then controlTool:Destroy() end
        if spearTool then spearTool:Destroy() end
        if blastTool then blastTool:Destroy() end
        if aimTargetModel then aimTargetModel:Destroy() end
        if controlOrb then controlOrb:Destroy() end
        if controlSound then controlSound:Destroy() end
        if runSound then runSound:Destroy() end
        if skydiveSound then skydiveSound:Destroy() end
        if highlight then highlight:Destroy() end
        if glowLight then glowLight:Destroy() end
        if chargeHighlight then chargeHighlight:Destroy() end
        if chargeLight then chargeLight:Destroy() end
        if boostSfx1 then boostSfx1:Destroy() end
        if boostSfx2 then boostSfx2:Destroy() end
        if boostLoopSfx then boostLoopSfx:Destroy() end
        walkTrack:Stop()  
        runTrack:Stop()  
        jumpTrack:Stop()  
        idleTrack:Stop()  
        skydiveTrack:Stop()
        fastFallTrack:Stop()
        controlTrack:Stop()  
        boostTrack:Stop()  
        spearThrowTrack:Stop() 
        chaosTransformTrack:Stop()
        trueSpeedAttackTrack:Stop()
        chaosExecutionTrack:Stop()
        chaosBlastTrack:Stop()
        currentSpeed = BASE_SPEED  
        camera.FieldOfView = FOV_BASE  
        camera.CameraType = Enum.CameraType.Custom  
        if runTrailL then runTrailL:Destroy() end  
        if runTrailR then runTrailR:Destroy() end  
        for _, t in ipairs(skydiveTrails) do if t then t:Destroy() end end
        
        if chaosModeLight then chaosModeLight:Destroy() end
        if rFootLight then rFootLight:Destroy() end
        if lFootLight then lFootLight:Destroy() end
    
        -- // CLEANUP NEW ASSETS //
        if chaosTorsoModel then chaosTorsoModel:Destroy() end
        if chaosStaticMapModel then chaosStaticMapModel:Destroy() end
    end)
end

-- // 3. EXECUTE GUI ON LOAD // --
CreateSelectionGui()
๐ŸŽฎ Similar Scripts
๐Ÿ’ฌ Comments (0)
Login to post a comment
No comments yet. Be the first!
Script Info
Game Just a baseplate
TypeKeyless
Authoralexriderr
Views42
Likes0
PublishedAug 8, 2026
๐ŸŽฎ Play Game on Roblox
๐Ÿ• Recent Scripts
AUTO COLLECT HONEY STEAL A BRAINROT
AUTO COLLECT HONEY STEAL A BRAINROT
Steal a Brainrot โ€ข ๐Ÿ‘ 3
Keyless
MM2 Torch Hub OP – Coin Auto Farm
MM2 Torch Hub OP – Coin Auto Farm
Murder Mystery 2 โ€ข ๐Ÿ‘ 5
Keyless
[NEW] TRAV HUB MM2 OP keyless
[NEW] TRAV HUB MM2 OP keyless
Murder Mystery 2 โ€ข ๐Ÿ‘ 6
Keyless
Innovation labs GUI
Innovation labs GUI
Innovation Labs โ€ข ๐Ÿ‘ 8
Keyless
Ouroboros Hub keyless Script For +1 Speed Evolve
Ouroboros Hub keyless Script For +1 Speed Evolve
+1 Speed Evolve โ€ข ๐Ÿ‘ 9
Keyless