Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local speeds = 1
- local nowe = false
- local tpwalking = false
- local tis, dis = nil, nil
- local isMinimized = false
- local function NewTween(obj, t, props)
- return TweenService:Create(obj, TweenInfo.new(t, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), props)
- end
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "CubixHubFly"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- local MainFrame = Instance.new("Frame")
- MainFrame.Name = "MainFrame"
- MainFrame.Size = UDim2.fromOffset(240, 180)
- MainFrame.Position = UDim2.new(0.5, -120, 0.5, -90)
- MainFrame.BackgroundColor3 = Color3.fromRGB(8, 8, 10)
- MainFrame.BorderSizePixel = 0
- MainFrame.Active = true
- MainFrame.Draggable = true
- MainFrame.Parent = ScreenGui
- local MainCorner = Instance.new("UICorner")
- MainCorner.CornerRadius = UDim.new(0, 14)
- MainCorner.Parent = MainFrame
- local MainStroke = Instance.new("UIStroke")
- MainStroke.Color = Color3.fromRGB(50, 50, 60)
- MainStroke.Thickness = 1.2
- MainStroke.Parent = MainFrame
- local Glow = Instance.new("ImageLabel")
- Glow.Name = "Glow"
- Glow.Size = UDim2.new(1, 40, 1, 40)
- Glow.Position = UDim2.new(0, -20, 0, -20)
- Glow.BackgroundTransparency = 1
- Glow.Image = "rbxassetid://5028857084"
- Glow.ImageColor3 = Color3.fromRGB(120, 80, 220)
- Glow.ImageTransparency = 0.82
- Glow.ZIndex = 0
- Glow.Parent = MainFrame
- local TopBar = Instance.new("Frame")
- TopBar.Name = "TopBar"
- TopBar.Size = UDim2.new(1, 0, 0, 38)
- TopBar.BackgroundColor3 = Color3.fromRGB(14, 12, 20)
- TopBar.BorderSizePixel = 0
- TopBar.Parent = MainFrame
- local TopCorner = Instance.new("UICorner")
- TopCorner.CornerRadius = UDim.new(0, 14)
- TopCorner.Parent = TopBar
- local TopFix = Instance.new("Frame")
- TopFix.Size = UDim2.new(1, 0, 0.5, 0)
- TopFix.Position = UDim2.new(0, 0, 0.5, 0)
- TopFix.BackgroundColor3 = Color3.fromRGB(14, 12, 20)
- TopFix.BorderSizePixel = 0
- TopFix.Parent = TopBar
- local TopAccent = Instance.new("Frame")
- TopAccent.Size = UDim2.new(1, 0, 0, 1)
- TopAccent.Position = UDim2.new(0, 0, 1, -1)
- TopAccent.BackgroundColor3 = Color3.fromRGB(90, 55, 180)
- TopAccent.BorderSizePixel = 0
- TopAccent.Parent = TopBar
- local TitleLabel = Instance.new("TextLabel")
- TitleLabel.Size = UDim2.new(1, -80, 1, 0)
- TitleLabel.Position = UDim2.new(0, 14, 0, 0)
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Text = "CUBIX HUB"
- TitleLabel.Font = Enum.Font.GothamBold
- TitleLabel.TextColor3 = Color3.fromRGB(230, 220, 255)
- TitleLabel.TextSize = 13
- TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- TitleLabel.Parent = TopBar
- local SubLabel = Instance.new("TextLabel")
- SubLabel.Size = UDim2.new(0, 60, 1, 0)
- SubLabel.Position = UDim2.new(0, 80, 0, 0)
- SubLabel.BackgroundTransparency= 1
- SubLabel.Text = "FLY"
- SubLabel.Font = Enum.Font.Gotham
- SubLabel.TextColor3 = Color3.fromRGB(120, 80, 220)
- SubLabel.TextSize = 11
- SubLabel.TextXAlignment = Enum.TextXAlignment.Left
- SubLabel.Parent = TopBar
- local CloseBtn = Instance.new("TextButton")
- CloseBtn.Name = "CloseBtn"
- CloseBtn.Size = UDim2.fromOffset(22, 22)
- CloseBtn.Position = UDim2.new(1, -30, 0.5, -11)
- CloseBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
- CloseBtn.Text = ""
- CloseBtn.BorderSizePixel = 0
- CloseBtn.Parent = TopBar
- local CloseCorner = Instance.new("UICorner")
- CloseCorner.CornerRadius = UDim.new(1, 0)
- CloseCorner.Parent = CloseBtn
- local CloseIcon = Instance.new("TextLabel")
- CloseIcon.Size = UDim2.new(1, 0, 1, 0)
- CloseIcon.BackgroundTransparency = 1
- CloseIcon.Text = "X"
- CloseIcon.Font = Enum.Font.GothamBold
- CloseIcon.TextColor3 = Color3.fromRGB(255, 255, 255)
- CloseIcon.TextSize = 10
- CloseIcon.Parent = CloseBtn
- local MinBtn = Instance.new("TextButton")
- MinBtn.Name = "MinBtn"
- MinBtn.Size = UDim2.fromOffset(22, 22)
- MinBtn.Position = UDim2.new(1, -56, 0.5, -11)
- MinBtn.BackgroundColor3 = Color3.fromRGB(35, 30, 55)
- MinBtn.Text = "-"
- MinBtn.BorderSizePixel = 0
- MinBtn.Parent = TopBar
- local MinCorner = Instance.new("UICorner")
- MinCorner.CornerRadius = UDim.new(1, 0)
- MinCorner.Parent = MinBtn
- local MinIcon = Instance.new("TextLabel")
- MinIcon.Size = UDim2.new(1, 0, 1, 0)
- MinIcon.BackgroundTransparency = 1
- MinIcon.Text = "—"
- MinIcon.Font = Enum.Font.GothamBold
- MinIcon.TextColor3 = Color3.fromRGB(180, 160, 220)
- MinIcon.TextSize = 10
- MinIcon.Parent = MinBtn
- local ContentFrame = Instance.new("Frame")
- ContentFrame.Name = "ContentFrame"
- ContentFrame.Size = UDim2.new(1, -24, 1, -52)
- ContentFrame.Position = UDim2.new(0, 12, 0, 44)
- ContentFrame.BackgroundTransparency = 1
- ContentFrame.Parent = MainFrame
- local function MakeButton(parent, text, posX, posY, w, h, accent)
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.fromOffset(w, h)
- btn.Position = UDim2.fromOffset(posX, posY)
- btn.BackgroundColor3 = accent or Color3.fromRGB(20, 18, 30)
- btn.Text = text
- btn.Font = Enum.Font.GothamBold
- btn.TextColor3 = Color3.fromRGB(210, 200, 240)
- btn.TextSize = 12
- btn.BorderSizePixel = 0
- btn.AutoButtonColor = false
- btn.Parent = parent
- local c = Instance.new("UICorner")
- c.CornerRadius = UDim.new(0, 8)
- c.Parent = btn
- local s = Instance.new("UIStroke")
- s.Color = Color3.fromRGB(55, 45, 80)
- s.Thickness = 1
- s.Parent = btn
- btn.MouseEnter:Connect(function()
- NewTween(btn, 0.15, { BackgroundColor3 = Color3.fromRGB(35, 28, 58) }):Play()
- end)
- btn.MouseLeave:Connect(function()
- NewTween(btn, 0.15, { BackgroundColor3 = accent or Color3.fromRGB(20, 18, 30) }):Play()
- end)
- return btn
- end
- local function MakeLabel(parent, text, posX, posY, w, h)
- local lbl = Instance.new("TextLabel")
- lbl.Size = UDim2.fromOffset(w, h)
- lbl.Position = UDim2.fromOffset(posX, posY)
- lbl.BackgroundColor3 = Color3.fromRGB(20, 18, 30)
- lbl.Text = text
- lbl.Font = Enum.Font.GothamBold
- lbl.TextColor3 = Color3.fromRGB(180, 160, 230)
- lbl.TextSize = 12
- lbl.BorderSizePixel = 0
- lbl.Parent = parent
- local c = Instance.new("UICorner")
- c.CornerRadius = UDim.new(0, 8)
- c.Parent = lbl
- local s = Instance.new("UIStroke")
- s.Color = Color3.fromRGB(55, 45, 80)
- s.Thickness = 1
- s.Parent = lbl
- return lbl
- end
- local FlyBtn = MakeButton(ContentFrame, "FLY OFF", 0, 0, 100, 36, Color3.fromRGB(18, 14, 32))
- local UpBtn = MakeButton(ContentFrame, "▲ UP", 0, 46, 100, 36)
- local DownBtn = MakeButton(ContentFrame, "▼ DOWN", 0, 90, 100, 36)
- local SpeedLbl = MakeLabel(ContentFrame, "1", 110, 0, 104, 36)
- SpeedLbl.TextSize = 16
- local PlusBtn = MakeButton(ContentFrame, "+", 110, 46, 50, 36, Color3.fromRGB(22, 18, 36))
- local MinusBtn = MakeButton(ContentFrame, "−", 164, 46, 50, 36, Color3.fromRGB(22, 18, 36))
- local SpeedHint = Instance.new("TextLabel")
- SpeedHint.Size = UDim2.fromOffset(104, 20)
- SpeedHint.Position = UDim2.fromOffset(110, 90)
- SpeedHint.BackgroundTransparency= 1
- SpeedHint.Text = "SPEED MULTIPLIER"
- SpeedHint.Font = Enum.Font.Gotham
- SpeedHint.TextColor3 = Color3.fromRGB(90, 80, 120)
- SpeedHint.TextSize = 8
- SpeedHint.Parent = ContentFrame
- local StatusDot = Instance.new("Frame")
- StatusDot.Size = UDim2.fromOffset(8, 8)
- StatusDot.Position = UDim2.new(0, 6, 0.5, -4)
- StatusDot.BackgroundColor3 = Color3.fromRGB(80, 80, 100)
- StatusDot.BorderSizePixel = 0
- StatusDot.Parent = TopBar
- local DotCorner = Instance.new("UICorner")
- DotCorner.CornerRadius = UDim.new(1, 0)
- DotCorner.Parent = StatusDot
- local function SetFlyStatus(active)
- if active then
- FlyBtn.Text = "FLY ON"
- NewTween(FlyBtn, 0.2, { BackgroundColor3 = Color3.fromRGB(28, 18, 55) }):Play()
- NewTween(StatusDot, 0.2, { BackgroundColor3 = Color3.fromRGB(120, 80, 220) }):Play()
- FlyBtn.UIStroke.Color = Color3.fromRGB(100, 60, 200)
- else
- FlyBtn.Text = "FLY OFF"
- NewTween(FlyBtn, 0.2, { BackgroundColor3 = Color3.fromRGB(18, 14, 32) }):Play()
- NewTween(StatusDot, 0.2, { BackgroundColor3 = Color3.fromRGB(80, 80, 100) }):Play()
- FlyBtn.UIStroke.Color = Color3.fromRGB(55, 45, 80)
- end
- end
- local speaker = LocalPlayer
- FlyBtn.MouseButton1Click:Connect(function()
- if nowe then
- nowe = false
- SetFlyStatus(false)
- local char = speaker.Character
- if not char then return end
- local hum = char:FindFirstChildWhichIsA("Humanoid")
- if not hum then return end
- for _, state in ipairs({
- Enum.HumanoidStateType.Climbing, Enum.HumanoidStateType.FallingDown,
- Enum.HumanoidStateType.Flying, Enum.HumanoidStateType.Freefall,
- Enum.HumanoidStateType.GettingUp,Enum.HumanoidStateType.Jumping,
- Enum.HumanoidStateType.Landed, Enum.HumanoidStateType.Physics,
- Enum.HumanoidStateType.PlatformStanding, Enum.HumanoidStateType.Ragdoll,
- Enum.HumanoidStateType.Running, Enum.HumanoidStateType.RunningNoPhysics,
- Enum.HumanoidStateType.Seated, Enum.HumanoidStateType.StrafingNoPhysics,
- Enum.HumanoidStateType.Swimming,
- }) do
- hum:SetStateEnabled(state, true)
- end
- hum:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
- else
- nowe = true
- SetFlyStatus(true)
- for _ = 1, speeds do
- task.spawn(function()
- local hb = RunService.Heartbeat
- tpwalking = true
- local chr = LocalPlayer.Character
- local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
- while tpwalking and hb:Wait() and chr and hum and hum.Parent do
- if hum.MoveDirection.Magnitude > 0 then
- chr:TranslateBy(hum.MoveDirection)
- end
- end
- end)
- end
- local char = LocalPlayer.Character
- if not char then return end
- local hum = char:FindFirstChildWhichIsA("Humanoid") or char:FindFirstChildOfClass("AnimationController")
- if char:FindFirstChild("Animate") then
- char.Animate.Disabled = true
- end
- if hum and hum:IsA("Humanoid") then
- for _, track in ipairs(hum:GetPlayingAnimationTracks()) do
- track:AdjustSpeed(0)
- end
- end
- local humObj = char:FindFirstChildWhichIsA("Humanoid")
- if humObj then
- for _, state in ipairs({
- Enum.HumanoidStateType.Climbing, Enum.HumanoidStateType.FallingDown,
- Enum.HumanoidStateType.Flying, Enum.HumanoidStateType.Freefall,
- Enum.HumanoidStateType.GettingUp,Enum.HumanoidStateType.Jumping,
- Enum.HumanoidStateType.Landed, Enum.HumanoidStateType.Physics,
- Enum.HumanoidStateType.PlatformStanding, Enum.HumanoidStateType.Ragdoll,
- Enum.HumanoidStateType.Running, Enum.HumanoidStateType.RunningNoPhysics,
- Enum.HumanoidStateType.Seated, Enum.HumanoidStateType.StrafingNoPhysics,
- Enum.HumanoidStateType.Swimming,
- }) do
- humObj:SetStateEnabled(state, false)
- end
- humObj:ChangeState(Enum.HumanoidStateType.Swimming)
- end
- local rigType = char:FindFirstChildOfClass("Humanoid") and char:FindFirstChildOfClass("Humanoid").RigType
- local torso = rigType == Enum.HumanoidRigType.R6 and char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
- if not torso then return end
- local bg = Instance.new("BodyGyro", torso)
- bg.P = 9e4
- bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
- bg.cframe = torso.CFrame
- local bv = Instance.new("BodyVelocity", torso)
- bv.velocity = Vector3.new(0, 0.1, 0)
- bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
- if humObj then humObj.PlatformStand = true end
- local ctrl = {f=0,b=0,l=0,r=0}
- local lastctrl = {f=0,b=0,l=0,r=0}
- local maxspeed = 50
- local spd = 0
- while nowe do
- RunService.RenderStepped:Wait()
- if ctrl.l+ctrl.r ~= 0 or ctrl.f+ctrl.b ~= 0 then
- spd = math.min(spd + 0.5 + spd/maxspeed, maxspeed)
- elseif spd ~= 0 then
- spd = math.max(spd - 1, 0)
- end
- local cam = workspace.CurrentCamera.CoordinateFrame
- if (ctrl.l+ctrl.r) ~= 0 or (ctrl.f+ctrl.b) ~= 0 then
- bv.velocity = ((cam.lookVector * (ctrl.f+ctrl.b)) + ((cam * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - cam.p)) * spd
- lastctrl = {f=ctrl.f,b=ctrl.b,l=ctrl.l,r=ctrl.r}
- elseif spd ~= 0 then
- bv.velocity = ((cam.lookVector * (lastctrl.f+lastctrl.b)) + ((cam * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - cam.p)) * spd
- else
- bv.velocity = Vector3.new(0, 0, 0)
- end
- bg.cframe = cam * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*spd/maxspeed), 0, 0)
- end
- ctrl = {f=0,b=0,l=0,r=0}
- lastctrl = {f=0,b=0,l=0,r=0}
- spd = 0
- bg:Destroy()
- bv:Destroy()
- if humObj then humObj.PlatformStand = false end
- if char:FindFirstChild("Animate") then
- char.Animate.Disabled = false
- end
- tpwalking = false
- end
- end)
- UpBtn.MouseButton1Down:Connect(function()
- tis = RunService.Heartbeat:Connect(function()
- local char = LocalPlayer.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- char.HumanoidRootPart.CFrame *= CFrame.new(0, 0.5, 0)
- end
- end)
- end)
- UpBtn.MouseButton1Up:Connect(function()
- if tis then tis:Disconnect() tis = nil end
- end)
- DownBtn.MouseButton1Down:Connect(function()
- dis = RunService.Heartbeat:Connect(function()
- local char = LocalPlayer.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- char.HumanoidRootPart.CFrame *= CFrame.new(0, -0.5, 0)
- end
- end)
- end)
- DownBtn.MouseButton1Up:Connect(function()
- if dis then dis:Disconnect() dis = nil end
- end)
- PlusBtn.MouseButton1Click:Connect(function()
- speeds += 1
- SpeedLbl.Text = tostring(speeds)
- if nowe then
- tpwalking = false
- for _ = 1, speeds do
- task.spawn(function()
- local hb = RunService.Heartbeat
- tpwalking = true
- local chr = LocalPlayer.Character
- local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
- while tpwalking and hb:Wait() and chr and hum and hum.Parent do
- if hum.MoveDirection.Magnitude > 0 then chr:TranslateBy(hum.MoveDirection) end
- end
- end)
- end
- end
- end)
- MinusBtn.MouseButton1Click:Connect(function()
- if speeds <= 1 then
- SpeedLbl.Text = "MIN"
- task.wait(0.8)
- SpeedLbl.Text = tostring(speeds)
- return
- end
- speeds -= 1
- SpeedLbl.Text = tostring(speeds)
- if nowe then
- tpwalking = false
- for _ = 1, speeds do
- task.spawn(function()
- local hb = RunService.Heartbeat
- tpwalking = true
- local chr = LocalPlayer.Character
- local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
- while tpwalking and hb:Wait() and chr and hum and hum.Parent do
- if hum.MoveDirection.Magnitude > 0 then chr:TranslateBy(hum.MoveDirection) end
- end
- end)
- end
- end
- end)
- CloseBtn.MouseButton1Click:Connect(function()
- NewTween(MainFrame, 0.2, { BackgroundTransparency = 1 }):Play()
- task.wait(0.2)
- ScreenGui:Destroy()
- end)
- MinBtn.MouseButton1Click:Connect(function()
- isMinimized = not isMinimized
- if isMinimized then
- NewTween(MainFrame, 0.25, { Size = UDim2.fromOffset(240, 38) }):Play()
- task.wait(0.05)
- ContentFrame.Visible = false
- MinIcon.Text = "+"
- else
- ContentFrame.Visible = true
- NewTween(MainFrame, 0.25, { Size = UDim2.fromOffset(240, 180) }):Play()
- MinIcon.Text = "—"
- end
- end)
- LocalPlayer.CharacterAdded:Connect(function()
- task.wait(0.7)
- local char = LocalPlayer.Character
- if not char then return end
- local hum = char:FindFirstChildWhichIsA("Humanoid")
- if hum then hum.PlatformStand = false end
- if char:FindFirstChild("Animate") then
- char.Animate.Disabled = false
- end
- nowe = false
- SetFlyStatus(false)
- end)
- NewTween(MainFrame, 0.35, { BackgroundTransparency = 0 }):Play()
Advertisement
Add Comment
Please, Sign In to add comment