Batman Hub Baseplate Script

Batman Hub Baseplate Script

Baseplate 3 days ago
8 views
Batman Hub Baseplate Script Keyless
eka.playz.111 playz eka.playz.111 playz
Play Game Game Link

Description

It’s just a random hub with a few things.

DON’T USE ON RIVALS, or if u do, use an alt account so you don’t get banned.

Features:

  • Fly
  • No Clip
  • Speed Hack
  • Sin bot
Features
Compatible Executors

Script

-- LocalScript inside StarterPlayerScripts or StarterGui

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")

-- ========================
-- GUI SETUP
-- ========================

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "BatmanHub"
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")

-- Main Frame
local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0, 300, 0, 470)
MainFrame.BackgroundColor3 = Color3.fromRGB(12, 12, 18)
MainFrame.BorderSizePixel = 0
MainFrame.Visible = false
MainFrame.Parent = ScreenGui

Instance.new("UICorner", MainFrame).CornerRadius = UDim.new(0, 12)

-- Drop shadow
local Shadow = Instance.new("ImageLabel")
Shadow.Size = UDim2.new(1, 30, 1, 30)
Shadow.Position = UDim2.new(0, -15, 0, -10)
Shadow.BackgroundTransparency = 1
Shadow.Image = "rbxassetid://5554236805"
Shadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
Shadow.ImageTransparency = 0.5
Shadow.ScaleType = Enum.ScaleType.Slice
Shadow.SliceCenter = Rect.new(23, 23, 277, 277)
Shadow.ZIndex = 0
Shadow.Parent = MainFrame

-- ========================
-- TITLE BAR
-- ========================

local TitleBar = Instance.new("Frame")
TitleBar.Size = UDim2.new(1, 0, 0, 48)
TitleBar.BackgroundColor3 = Color3.fromRGB(18, 18, 28)
TitleBar.BorderSizePixel = 0
TitleBar.Parent = MainFrame

Instance.new("UICorner", TitleBar).CornerRadius = UDim.new(0, 12)

local TitlePatch = Instance.new("Frame")
TitlePatch.Size = UDim2.new(1, 0, 0, 12)
TitlePatch.Position = UDim2.new(0, 0, 1, -12)
TitlePatch.BackgroundColor3 = Color3.fromRGB(18, 18, 28)
TitlePatch.BorderSizePixel = 0
TitlePatch.Parent = TitleBar

local AccentLine = Instance.new("Frame")
AccentLine.Size = UDim2.new(1, 0, 0, 2)
AccentLine.Position = UDim2.new(0, 0, 1, 0)
AccentLine.BackgroundColor3 = Color3.fromRGB(90, 90, 220)
AccentLine.BorderSizePixel = 0
AccentLine.Parent = TitleBar

local TitleLabel = Instance.new("TextLabel")
TitleLabel.Size = UDim2.new(1, -50, 1, 0)
TitleLabel.Position = UDim2.new(0, 16, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.Text = "🦇  Batman Hub"
TitleLabel.TextColor3 = Color3.fromRGB(230, 230, 255)
TitleLabel.TextSize = 17
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.Parent = TitleBar

local CloseBtn = Instance.new("TextButton")
CloseBtn.Size = UDim2.new(0, 28, 0, 28)
CloseBtn.Position = UDim2.new(1, -36, 0.5, -14)
CloseBtn.BackgroundColor3 = Color3.fromRGB(200, 55, 55)
CloseBtn.Text = "✕"
CloseBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseBtn.TextSize = 13
CloseBtn.Font = Enum.Font.GothamBold
CloseBtn.BorderSizePixel = 0
CloseBtn.Parent = TitleBar

Instance.new("UICorner", CloseBtn).CornerRadius = UDim.new(0, 6)

-- ========================
-- CONTENT AREA
-- ========================

local Content = Instance.new("Frame")
Content.Size = UDim2.new(1, 0, 1, -52)
Content.Position = UDim2.new(0, 0, 0, 52)
Content.BackgroundTransparency = 1
Content.Parent = MainFrame

local ContentPadding = Instance.new("UIPadding")
ContentPadding.PaddingLeft = UDim.new(0, 18)
ContentPadding.PaddingRight = UDim.new(0, 18)
ContentPadding.PaddingTop = UDim.new(0, 14)
ContentPadding.Parent = Content

local ContentLayout = Instance.new("UIListLayout")
ContentLayout.SortOrder = Enum.SortOrder.LayoutOrder
ContentLayout.Padding = UDim.new(0, 14)
ContentLayout.Parent = Content

-- ========================
-- HELPER: make a slider row
-- ========================

local function makeSlider(parent, labelText, fillColor, knobColor, layoutOrder)
    local Container = Instance.new("Frame")
    Container.Size = UDim2.new(1, 0, 0, 52)
    Container.BackgroundTransparency = 1
    Container.LayoutOrder = layoutOrder
    Container.Parent = parent

    local Label = Instance.new("TextLabel")
    Label.Size = UDim2.new(1, 0, 0, 20)
    Label.BackgroundTransparency = 1
    Label.Text = labelText
    Label.TextColor3 = Color3.fromRGB(200, 200, 220)
    Label.TextSize = 13
    Label.Font = Enum.Font.Gotham
    Label.TextXAlignment = Enum.TextXAlignment.Left
    Label.Parent = Container

    local Track = Instance.new("Frame")
    Track.Size = UDim2.new(1, 0, 0, 8)
    Track.Position = UDim2.new(0, 0, 0, 30)
    Track.BackgroundColor3 = Color3.fromRGB(38, 38, 55)
    Track.BorderSizePixel = 0
    Track.Parent = Container

    Instance.new("UICorner", Track).CornerRadius = UDim.new(1, 0)

    local Fill = Instance.new("Frame")
    Fill.Size = UDim2.new(0, 0, 1, 0)
    Fill.BackgroundColor3 = fillColor
    Fill.BorderSizePixel = 0
    Fill.Parent = Track

    Instance.new("UICorner", Fill).CornerRadius = UDim.new(1, 0)

    local Knob = Instance.new("TextButton")
    Knob.Size = UDim2.new(0, 18, 0, 18)
    Knob.Position = UDim2.new(0, -9, 0.5, -9)
    Knob.BackgroundColor3 = knobColor
    Knob.Text = ""
    Knob.BorderSizePixel = 0
    Knob.ZIndex = 3
    Knob.Parent = Track

    Instance.new("UICorner", Knob).CornerRadius = UDim.new(1, 0)

    return Label, Track, Fill, Knob
end

-- ========================
-- SPEED SECTION
-- ========================

local SpeedLabel, SpeedTrack, SpeedFill, SpeedKnob = makeSlider(
    Content, "Walk Speed: 16",
    Color3.fromRGB(90, 100, 255), Color3.fromRGB(140, 150, 255), 1
)

local Div1 = Instance.new("Frame")
Div1.Size = UDim2.new(1, 0, 0, 1)
Div1.BackgroundColor3 = Color3.fromRGB(38, 38, 55)
Div1.BorderSizePixel = 0
Div1.LayoutOrder = 2
Div1.Parent = Content

-- ========================
-- SPIN SECTION
-- ========================

local SpinLabel, SpinTrack, SpinFill, SpinKnob = makeSlider(
    Content, "Spin Speed: 10",
    Color3.fromRGB(220, 130, 40), Color3.fromRGB(255, 175, 80), 3
)

local SpinBtnContainer = Instance.new("Frame")
SpinBtnContainer.Size = UDim2.new(1, 0, 0, 36)
SpinBtnContainer.BackgroundTransparency = 1
SpinBtnContainer.LayoutOrder = 4
SpinBtnContainer.Parent = Content

local SpinBtn = Instance.new("TextButton")
SpinBtn.Size = UDim2.new(1, 0, 1, 0)
SpinBtn.BackgroundColor3 = Color3.fromRGB(60, 40, 140)
SpinBtn.Text = "🌀  Start Spinning"
SpinBtn.TextColor3 = Color3.fromRGB(220, 220, 255)
SpinBtn.TextSize = 14
SpinBtn.Font = Enum.Font.GothamBold
SpinBtn.BorderSizePixel = 0
SpinBtn.Parent = SpinBtnContainer

Instance.new("UICorner", SpinBtn).CornerRadius = UDim.new(0, 8)

local Div2 = Instance.new("Frame")
Div2.Size = UDim2.new(1, 0, 0, 1)
Div2.BackgroundColor3 = Color3.fromRGB(38, 38, 55)
Div2.BorderSizePixel = 0
Div2.LayoutOrder = 5
Div2.Parent = Content

-- ========================
-- CLICK TP SECTION
-- ========================

local ClickTPContainer = Instance.new("Frame")
ClickTPContainer.Size = UDim2.new(1, 0, 0, 36)
ClickTPContainer.BackgroundTransparency = 1
ClickTPContainer.LayoutOrder = 6
ClickTPContainer.Parent = Content

local ClickTPBtn = Instance.new("TextButton")
ClickTPBtn.Size = UDim2.new(1, 0, 1, 0)
ClickTPBtn.BackgroundColor3 = Color3.fromRGB(30, 100, 60)
ClickTPBtn.Text = "🖱️  Click TP: OFF"
ClickTPBtn.TextColor3 = Color3.fromRGB(180, 255, 200)
ClickTPBtn.TextSize = 14
ClickTPBtn.Font = Enum.Font.GothamBold
ClickTPBtn.BorderSizePixel = 0
ClickTPBtn.Parent = ClickTPContainer

Instance.new("UICorner", ClickTPBtn).CornerRadius = UDim.new(0, 8)

local Div3 = Instance.new("Frame")
Div3.Size = UDim2.new(1, 0, 0, 1)
Div3.BackgroundColor3 = Color3.fromRGB(38, 38, 55)
Div3.BorderSizePixel = 0
Div3.LayoutOrder = 7
Div3.Parent = Content

-- ========================
-- FLY SECTION (slider + button)
-- ========================

local FlyLabel, FlyTrack, FlyFill, FlyKnob = makeSlider(
    Content, "Fly Speed: 60",
    Color3.fromRGB(50, 120, 210), Color3.fromRGB(120, 180, 255), 8
)

local FlyContainer = Instance.new("Frame")
FlyContainer.Size = UDim2.new(1, 0, 0, 36)
FlyContainer.BackgroundTransparency = 1
FlyContainer.LayoutOrder = 9
FlyContainer.Parent = Content

local FlyBtn = Instance.new("TextButton")
FlyBtn.Size = UDim2.new(1, 0, 1, 0)
FlyBtn.BackgroundColor3 = Color3.fromRGB(40, 80, 140)
FlyBtn.Text = "✈️  Fly: OFF"
FlyBtn.TextColor3 = Color3.fromRGB(190, 220, 255)
FlyBtn.TextSize = 14
FlyBtn.Font = Enum.Font.GothamBold
FlyBtn.BorderSizePixel = 0
FlyBtn.Parent = FlyContainer

Instance.new("UICorner", FlyBtn).CornerRadius = UDim.new(0, 8)

-- ========================
-- OPEN TOGGLE BUTTON
-- ========================

local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Size = UDim2.new(0, 160, 0, 38)
ToggleBtn.Position = UDim2.new(0, 16, 1, -60)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 50)
ToggleBtn.Text = "🦇  Batman Hub  [K]"
ToggleBtn.TextColor3 = Color3.fromRGB(200, 200, 255)
ToggleBtn.TextSize = 13
ToggleBtn.Font = Enum.Font.GothamBold
ToggleBtn.BorderSizePixel = 0
ToggleBtn.Parent = ScreenGui

Instance.new("UICorner", ToggleBtn).CornerRadius = UDim.new(0, 8)

local ToggleStroke = Instance.new("UIStroke")
ToggleStroke.Color = Color3.fromRGB(70, 70, 160)
ToggleStroke.Thickness = 1.5
ToggleStroke.Parent = ToggleBtn

local HintLabel = Instance.new("TextLabel")
HintLabel.Size = UDim2.new(0, 160, 0, 18)
HintLabel.Position = UDim2.new(0, 16, 1, -20)
HintLabel.BackgroundTransparency = 1
HintLabel.Text = "Press K to toggle"
HintLabel.TextColor3 = Color3.fromRGB(120, 120, 160)
HintLabel.TextSize = 11
HintLabel.Font = Enum.Font.Gotham
HintLabel.TextXAlignment = Enum.TextXAlignment.Left
HintLabel.Parent = ScreenGui

-- ========================
-- DRAG LOGIC (smooth lerp)
-- ========================

local screenSize = workspace.CurrentCamera.ViewportSize
local targetX = (screenSize.X / 2) - 150
local targetY = (screenSize.Y / 2) - 235
local currentX = targetX
local currentY = targetY
local LERP_SPEED = 18

MainFrame.Position = UDim2.new(0, currentX, 0, currentY)

local draggingWindow = false
local dragOffsetX = 0
local dragOffsetY = 0

TitleBar.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        draggingWindow = true
        local mousePos = UserInputService:GetMouseLocation()
        dragOffsetX = mousePos.X - MainFrame.Position.X.Offset
        dragOffsetY = mousePos.Y - MainFrame.Position.Y.Offset
    end
end)

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

-- ========================
-- STATE VARIABLES
-- ========================

local minSpeed, maxSpeed = 16, 200
local minSpin, maxSpin = 1, 100
local minFly, maxFly = 20, 300
local currentSpinSpeed = 10
local flySpeed = 60
local isSpinning = false
local isClickTP = false
local flying = false
local draggingSpeed = false
local draggingSpin = false
local draggingFly = false
local spinConnection = nil
local clickTPConnection = nil
local flyConnection = nil
local flyBodyVelocity = nil
local flyBodyGyro = nil

-- Spin knockback tuning
local KNOCKBACK_FORCE = 120  -- horizontal launch strength
local KNOCKBACK_UP = 55      -- upward launch strength
local knockbackDebounce = {} -- [player] = true while on cooldown
local touchConnections = {}

-- ========================
-- SLIDER LOGIC
-- ========================

local function updateSpeed(value)
    local speed = math.floor(minSpeed + (maxSpeed - minSpeed) * value)
    SpeedLabel.Text = "Walk Speed: " .. speed
    SpeedFill.Size = UDim2.new(value, 0, 1, 0)
    SpeedKnob.Position = UDim2.new(value, -9, 0.5, -9)
    if Humanoid then Humanoid.WalkSpeed = speed end
end

local function updateSpinSpeed(value)
    currentSpinSpeed = math.floor(minSpin + (maxSpin - minSpin) * value)
    SpinLabel.Text = "Spin Speed: " .. currentSpinSpeed
    SpinFill.Size = UDim2.new(value, 0, 1, 0)
    SpinKnob.Position = UDim2.new(value, -9, 0.5, -9)
end

local function updateFlySpeed(value)
    flySpeed = math.floor(minFly + (maxFly - minFly) * value)
    FlyLabel.Text = "Fly Speed: " .. flySpeed
    FlyFill.Size = UDim2.new(value, 0, 1, 0)
    FlyKnob.Position = UDim2.new(value, -9, 0.5, -9)
end

-- Set fly slider to reflect the default (60)
updateFlySpeed((flySpeed - minFly) / (maxFly - minFly))

SpeedKnob.MouseButton1Down:Connect(function() draggingSpeed = true end)
SpinKnob.MouseButton1Down:Connect(function() draggingSpin = true end)
FlyKnob.MouseButton1Down:Connect(function() draggingFly = true end)

UserInputService.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        draggingSpeed = false
        draggingSpin = false
        draggingFly = false
        draggingWindow = false
    end
end)

-- ========================
-- SPIN LOGIC
-- ========================

local function startSpinning()
    isSpinning = true
    SpinBtn.Text = "🛑  Stop Spinning"
    SpinBtn.BackgroundColor3 = Color3.fromRGB(130, 30, 30)
    spinConnection = RunService.RenderStepped:Connect(function(dt)
        if HRP and isSpinning then
            HRP.CFrame = HRP.CFrame * CFrame.Angles(0, math.rad(currentSpinSpeed * dt * 60), 0)
        end
    end)
end

local function stopSpinning()
    isSpinning = false
    SpinBtn.Text = "🌀  Start Spinning"
    SpinBtn.BackgroundColor3 = Color3.fromRGB(60, 40, 140)
    if spinConnection then spinConnection:Disconnect() spinConnection = nil end
end

SpinBtn.MouseButton1Click:Connect(function()
    if isSpinning then stopSpinning() else startSpinning() end
end)

-- ========================
-- SPIN KNOCKBACK (touch a player while spinning -> launch them)
-- ========================

local function launchPlayer(otherChar)
    local otherHRP = otherChar:FindFirstChild("HumanoidRootPart")
    if not otherHRP or not HRP then return end
    local otherPlayer = Players:GetPlayerFromCharacter(otherChar)
    if otherPlayer and knockbackDebounce[otherPlayer] then return end

    local direction = (otherHRP.Position - HRP.Position)
    if direction.Magnitude > 0 then
        direction = direction.Unit
    else
        direction = HRP.CFrame.LookVector
    end

    -- launch them away + a bit upward
    otherHRP.AssemblyLinearVelocity = direction * KNOCKBACK_FORCE + Vector3.new(0, KNOCKBACK_UP, 0)

    if otherPlayer then
        knockbackDebounce[otherPlayer] = true
        task.delay(0.6, function()
            knockbackDebounce[otherPlayer] = nil
        end)
    end
end

local function hookCharacterTouch(char)
    for _, c in ipairs(touchConnections) do c:Disconnect() end
    touchConnections = {}
    for _, part in ipairs(char:GetDescendants()) do
        if part:IsA("BasePart") then
            local conn = part.Touched:Connect(function(hit)
                if not isSpinning then return end
                local otherChar = hit.Parent
                if not otherChar then return end
                local otherPlayer = Players:GetPlayerFromCharacter(otherChar)
                -- handle accessories/hats (part is nested one level deeper)
                if not otherPlayer and otherChar.Parent then
                    otherChar = otherChar.Parent
                    otherPlayer = Players:GetPlayerFromCharacter(otherChar)
                end
                if otherPlayer and otherPlayer ~= LocalPlayer then
                    launchPlayer(otherChar)
                end
            end)
            table.insert(touchConnections, conn)
        end
    end
end

hookCharacterTouch(Character)

-- ========================
-- CLICK TP LOGIC
-- ========================

local Camera = workspace.CurrentCamera

local function enableClickTP()
    isClickTP = true
    ClickTPBtn.Text = "🖱️  Click TP: ON"
    ClickTPBtn.BackgroundColor3 = Color3.fromRGB(20, 160, 80)

    clickTPConnection = UserInputService.InputBegan:Connect(function(input, gameProcessed)
        if gameProcessed then return end
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            local unitRay = Camera:ScreenPointToRay(input.Position.X, input.Position.Y)
            local raycastParams = RaycastParams.new()
            raycastParams.FilterDescendantsInstances = {Character}
            raycastParams.FilterType = Enum.RaycastFilterType.Exclude
            local result = workspace:Raycast(unitRay.Origin, unitRay.Direction * 1000, raycastParams)
            if result then
                HRP.CFrame = CFrame.new(result.Position + Vector3.new(0, 3, 0))
            end
        end
    end)
end

local function disableClickTP()
    isClickTP = false
    ClickTPBtn.Text = "🖱️  Click TP: OFF"
    ClickTPBtn.BackgroundColor3 = Color3.fromRGB(30, 100, 60)
    if clickTPConnection then clickTPConnection:Disconnect() clickTPConnection = nil end
end

ClickTPBtn.MouseButton1Click:Connect(function()
    if isClickTP then disableClickTP() else enableClickTP() end
end)

-- ========================
-- FLY LOGIC
-- ========================

local function startFlying()
    flyBodyVelocity = Instance.new("BodyVelocity")
    flyBodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    flyBodyVelocity.Velocity = Vector3.new(0, 0, 0)
    flyBodyVelocity.Parent = HRP

    flyBodyGyro = Instance.new("BodyGyro")
    flyBodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
    flyBodyGyro.P = 10000
    flyBodyGyro.CFrame = HRP.CFrame
    flyBodyGyro.Parent = HRP

    flyConnection = RunService.RenderStepped:Connect(function()
        local camera = workspace.CurrentCamera
        local moveDirection = Vector3.new(0, 0, 0)
        local cf = camera.CFrame
        local lookVector = cf.LookVector
        local rightVector = cf.RightVector

        if UserInputService:IsKeyDown(Enum.KeyCode.W) then moveDirection += lookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then moveDirection -= lookVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then moveDirection -= rightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then moveDirection += rightVector end
        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then moveDirection += Vector3.new(0, 1, 0) end
        if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then moveDirection -= Vector3.new(0, 1, 0) end

        if moveDirection.Magnitude > 0 then
            moveDirection = moveDirection.Unit
        end

        flyBodyVelocity.Velocity = moveDirection * flySpeed
        flyBodyGyro.CFrame = camera.CFrame
    end)
end

local function stopFlying()
    if flyConnection then flyConnection:Disconnect() flyConnection = nil end
    if flyBodyVelocity then flyBodyVelocity:Destroy() flyBodyVelocity = nil end
    if flyBodyGyro then flyBodyGyro:Destroy() flyBodyGyro = nil end
end

local function toggleFly()
    flying = not flying
    if flying then
        startFlying()
        FlyBtn.Text = "✈️  Fly: ON"
        FlyBtn.BackgroundColor3 = Color3.fromRGB(60, 130, 220)
    else
        stopFlying()
        FlyBtn.Text = "✈️  Fly: OFF"
        FlyBtn.BackgroundColor3 = Color3.fromRGB(40, 80, 140)
    end
end

FlyBtn.MouseButton1Click:Connect(toggleFly)

-- ========================
-- MAIN RENDER LOOP
-- ========================

RunService.RenderStepped:Connect(function(dt)
    local mousePos = UserInputService:GetMouseLocation()
    local mouseX = mousePos.X

    if draggingWindow then
        targetX = mousePos.X - dragOffsetX
        targetY = mousePos.Y - dragOffsetY
    end

    currentX = currentX + (targetX - currentX) * math.min(1, LERP_SPEED * dt)
    currentY = currentY + (targetY - currentY) * math.min(1, LERP_SPEED * dt)
    MainFrame.Position = UDim2.new(0, currentX, 0, currentY)

    if draggingSpeed then
        local trackPos = SpeedTrack.AbsolutePosition.X
        local trackWidth = SpeedTrack.AbsoluteSize.X
        updateSpeed(math.clamp((mouseX - trackPos) / trackWidth, 0, 1))
    end

    if draggingSpin then
        local trackPos = SpinTrack.AbsolutePosition.X
        local trackWidth = SpinTrack.AbsoluteSize.X
        updateSpinSpeed(math.clamp((mouseX - trackPos) / trackWidth, 0, 1))
    end

    if draggingFly then
        local trackPos = FlyTrack.AbsolutePosition.X
        local trackWidth = FlyTrack.AbsoluteSize.X
        updateFlySpeed(math.clamp((mouseX - trackPos) / trackWidth, 0, 1))
    end
end)

-- ========================
-- TOGGLE / CLOSE
-- ========================

local function toggleHub()
    MainFrame.Visible = not MainFrame.Visible
end

ToggleBtn.MouseButton1Click:Connect(toggleHub)

CloseBtn.MouseButton1Click:Connect(function()
    MainFrame.Visible = false
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.K then
        toggleHub()
    end
end)

-- ========================
-- RESPAWN HANDLER
-- ========================

LocalPlayer.CharacterAdded:Connect(function(newChar)
    Character = newChar
    Humanoid = newChar:WaitForChild("Humanoid")
    HRP = newChar:WaitForChild("HumanoidRootPart")
    hookCharacterTouch(newChar)
    if isSpinning then stopSpinning() end
    if isClickTP then disableClickTP() end
    if flying then
        flying = false
        stopFlying()
        FlyBtn.Text = "✈️  Fly: OFF"
        FlyBtn.BackgroundColor3 = Color3.fromRGB(40, 80, 140)
    end
end)

Comments (0)

No comments yet. Be the first!