-- 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 ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")
-- RemoteEvent for server-side spin knockback (created by SpinKnockbackServer).
-- Timeout so the hub still loads if the server Script isn't present.
local knockbackEvent = ReplicatedStorage:WaitForChild("SpinKnockback", 5)
-- ========================
-- INTRO SPLASH
-- ========================
do
local introGui = Instance.new("ScreenGui")
introGui.Name = "BatmanIntro"
introGui.ResetOnSpawn = false
introGui.IgnoreGuiInset = true
introGui.DisplayOrder = 999
introGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
local bg=Instance.new("Frame")
bg.Size=UDim2.new(1,0,1,0)
bg.BackgroundColor3=Color3.new(0,0,0)
bg.BorderSizePixel=0
bg.Parent=introGui
local logo=Instance.new("TextLabel")
logo.AnchorPoint=Vector2.new(.5,.5)
logo.Position=UDim2.new(.5,0,.5,0)
logo.Size=UDim2.new(0,10,0,10)
logo.BackgroundTransparency=1
logo.Text="🦇"
logo.TextScaled=true
logo.TextColor3=Color3.fromRGB(240,220,60)
logo.TextTransparency=1
logo.Font=Enum.Font.GothamBold
logo.Parent=bg
logo:TweenSize(UDim2.new(0,200,0,200),Enum.EasingDirection.Out,Enum.EasingStyle.Back,.5,true)
TweenService:Create(logo,TweenInfo.new(.4),{TextTransparency=0}):Play()
local function spawnBat(d)
task.delay(d,function()
local bat=Instance.new("TextLabel")
bat.AnchorPoint=Vector2.new(.5,.5)
bat.Position=UDim2.new(.5,0,.5,0)
bat.Size=UDim2.new(0,28,0,28)
bat.BackgroundTransparency=1
bat.Text="🦇";bat.TextScaled=true
bat.TextColor3=Color3.fromRGB(20,20,20)
bat.Font=Enum.Font.GothamBold
bat.Parent=bg
local a=math.random()*math.pi*2
local dist=math.random(220,420)
TweenService:Create(bat,TweenInfo.new(.9+math.random()*.4,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{
Position=UDim2.new(.5,math.cos(a)*dist,.5,math.sin(a)*dist),
TextTransparency=1,Size=UDim2.new(0,14,0,14)}):Play()
task.delay(1.4,function() bat:Destroy() end)
end)
end
task.delay(.55,function() for i=1,26 do spawnBat(math.random()*.15) end end)
task.delay(2.1,function()
TweenService:Create(bg,TweenInfo.new(.6),{BackgroundTransparency=1}):Play()
TweenService:Create(logo,TweenInfo.new(.5),{TextTransparency=1,Size=UDim2.new(0,260,0,260)}):Play()
task.delay(.7,function() introGui:Destroy() end)
end)
end
-- ========================
-- 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, 520)
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)
-- ========================
-- NOCLIP SECTION
-- ========================
local NoclipContainer = Instance.new("Frame")
NoclipContainer.Size = UDim2.new(1, 0, 0, 36)
NoclipContainer.BackgroundTransparency = 1
NoclipContainer.LayoutOrder = 7
NoclipContainer.Parent = Content
local NoclipBtn = Instance.new("TextButton")
NoclipBtn.Size = UDim2.new(1, 0, 1, 0)
NoclipBtn.BackgroundColor3 = Color3.fromRGB(100, 60, 130)
NoclipBtn.Text = "👻 Noclip: OFF"
NoclipBtn.TextColor3 = Color3.fromRGB(225, 200, 255)
NoclipBtn.TextSize = 14
NoclipBtn.Font = Enum.Font.GothamBold
NoclipBtn.BorderSizePixel = 0
NoclipBtn.Parent = NoclipContainer
Instance.new("UICorner", NoclipBtn).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 = 8
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), 9
)
local FlyContainer = Instance.new("Frame")
FlyContainer.Size = UDim2.new(1, 0, 0, 36)
FlyContainer.BackgroundTransparency = 1
FlyContainer.LayoutOrder = 10
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) - 260
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 noclipping = false
local flying = false
local draggingSpeed = false
local draggingSpin = false
local draggingFly = false
local spinConnection = nil
local clickTPConnection = nil
local noclipConnection = nil
local flyConnection = nil
local flyBodyVelocity = nil
local flyBodyGyro = nil
-- Spin knockback tuning
local KNOCKBACK_FORCE = 120
local KNOCKBACK_UP = 55
local knockbackDebounce = {}
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
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 (fires to server, which has authority to move other players)
-- ========================
local function launchPlayer(otherChar)
local otherHRP = otherChar:FindFirstChild("HumanoidRootPart")
if not otherHRP or not HRP then return end
local otherPlayer = Players:GetPlayerFromCharacter(otherChar)
if not otherPlayer then return end
if 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
-- only fire if the server event exists; hub still works without it
if knockbackEvent then
knockbackEvent:FireServer(otherPlayer, direction, KNOCKBACK_FORCE, KNOCKBACK_UP)
end
knockbackDebounce[otherPlayer] = true
task.delay(0.6, function()
knockbackDebounce[otherPlayer] = nil
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)
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)
-- ========================
-- NOCLIP LOGIC
-- ========================
local function setCharacterCollision(char, canCollide)
for _, part in ipairs(char:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = canCollide
end
end
end
local function startNoclip()
setCharacterCollision(Character, false)
noclipConnection = RunService.Stepped:Connect(function()
if Character then
setCharacterCollision(Character, false)
end
end)
end
local function stopNoclip()
if noclipConnection then
noclipConnection:Disconnect()
noclipConnection = nil
end
if Character then
setCharacterCollision(Character, true)
end
end
local function toggleNoclip()
noclipping = not noclipping
if noclipping then
startNoclip()
NoclipBtn.Text = "👻 Noclip: ON"
NoclipBtn.BackgroundColor3 = Color3.fromRGB(140, 90, 200)
else
stopNoclip()
NoclipBtn.Text = "👻 Noclip: OFF"
NoclipBtn.BackgroundColor3 = Color3.fromRGB(100, 60, 130)
end
end
NoclipBtn.MouseButton1Click:Connect(toggleNoclip)
-- ========================
-- 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 noclipping then
noclipping = false
stopNoclip()
NoclipBtn.Text = "👻 Noclip: OFF"
NoclipBtn.BackgroundColor3 = Color3.fromRGB(100, 60, 130)
end
if flying then
flying = false
stopFlying()
FlyBtn.Text = "✈️ Fly: OFF"
FlyBtn.BackgroundColor3 = Color3.fromRGB(40, 80, 140)
end
end)