Not a member of GistPad yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- local LocalPlayer = Players.LocalPlayer
- local Camera = Workspace.CurrentCamera
- -- Flight Settings
- local displaySpeed = 30 -- Default set to 30 (Fast!)
- local minSpeed = 1
- local maxSpeed = 50
- local SPEED_MULTIPLIER = 6 -- Multiplies value so '30' feels extremely fast
- local isFlying = false
- local mobileAscend = 0
- -- Physical Components
- local character, human, root
- local linearVelocity, alignOrientation, attachment
- --------------------------------------------------------------------------------
- -- GUI CREATION
- --------------------------------------------------------------------------------
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "FlyControlGui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- -- Main Menu Frame
- local mainFrame = Instance.new("Frame")
- mainFrame.Name = "MainFrame"
- mainFrame.Size = UDim2.new(0, 220, 0, 180)
- mainFrame.Position = UDim2.new(0.85, -110, 0.5, -90)
- mainFrame.BackgroundColor3 = Color3.fromRGB(20, 22, 30)
- mainFrame.BorderSizePixel = 0
- mainFrame.Active = true
- mainFrame.Draggable = true
- mainFrame.Parent = screenGui
- local mainCorner = Instance.new("UICorner")
- mainCorner.CornerRadius = UDim.new(0, 10)
- mainCorner.Parent = mainFrame
- local mainStroke = Instance.new("UIStroke")
- mainStroke.Color = Color3.fromRGB(50, 55, 75)
- mainStroke.Thickness = 1.5
- mainStroke.Parent = mainFrame
- -- Title Bar
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Size = UDim2.new(1, -20, 0, 30)
- titleLabel.Position = UDim2.new(0, 10, 0, 5)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Text = "FLIGHT CONTROL"
- titleLabel.TextColor3 = Color3.fromRGB(200, 205, 220)
- titleLabel.TextSize = 13
- titleLabel.Font = Enum.Font.GothamBold
- titleLabel.TextXAlignment = Enum.TextXAlignment.Left
- titleLabel.Parent = mainFrame
- -- Toggle Fly Button
- local flyBtn = Instance.new("TextButton")
- flyBtn.Size = UDim2.new(1, -20, 0, 38)
- flyBtn.Position = UDim2.new(0, 10, 0, 35)
- flyBtn.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
- flyBtn.Text = "ENABLE FLY"
- flyBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- flyBtn.TextSize = 14
- flyBtn.Font = Enum.Font.GothamBold
- flyBtn.Parent = mainFrame
- local flyCorner = Instance.new("UICorner")
- flyCorner.CornerRadius = UDim.new(0, 6)
- flyCorner.Parent = flyBtn
- -- Speed Control Container
- local speedFrame = Instance.new("Frame")
- speedFrame.Size = UDim2.new(1, -20, 0, 40)
- speedFrame.Position = UDim2.new(0, 10, 0, 80)
- speedFrame.BackgroundColor3 = Color3.fromRGB(30, 33, 45)
- speedFrame.BorderSizePixel = 0
- speedFrame.Parent = mainFrame
- local speedCorner = Instance.new("UICorner")
- speedCorner.CornerRadius = UDim.new(0, 6)
- speedCorner.Parent = speedFrame
- -- Speed Decrease (-)
- local decBtn = Instance.new("TextButton")
- decBtn.Size = UDim2.new(0, 35, 1, 0)
- decBtn.Position = UDim2.new(0, 0, 0, 0)
- decBtn.BackgroundColor3 = Color3.fromRGB(45, 50, 68)
- decBtn.Text = "-"
- decBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- decBtn.TextSize = 18
- decBtn.Font = Enum.Font.GothamBold
- decBtn.Parent = speedFrame
- local decCorner = Instance.new("UICorner")
- decCorner.CornerRadius = UDim.new(0, 6)
- decCorner.Parent = decBtn
- -- Speed Display / Input
- local speedBox = Instance.new("TextBox")
- speedBox.Size = UDim2.new(1, -70, 1, 0)
- speedBox.Position = UDim2.new(0, 35, 0, 0)
- speedBox.BackgroundTransparency = 1
- speedBox.Text = "Speed: " .. tostring(displaySpeed)
- speedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- speedBox.TextSize = 13
- speedBox.Font = Enum.Font.GothamMedium
- speedBox.Parent = speedFrame
- -- Speed Increase (+)
- local incBtn = Instance.new("TextButton")
- incBtn.Size = UDim2.new(0, 35, 1, 0)
- incBtn.Position = UDim2.new(1, -35, 0, 0)
- incBtn.BackgroundColor3 = Color3.fromRGB(45, 50, 68)
- incBtn.Text = "+"
- incBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- incBtn.TextSize = 18
- incBtn.Font = Enum.Font.GothamBold
- incBtn.Parent = speedFrame
- local incCorner = Instance.new("UICorner")
- incCorner.CornerRadius = UDim.new(0, 6)
- incCorner.Parent = incBtn
- -- Mobile Altitude Controls Container
- local mobileFrame = Instance.new("Frame")
- mobileFrame.Size = UDim2.new(1, -20, 0, 40)
- mobileFrame.Position = UDim2.new(0, 10, 0, 130)
- mobileFrame.BackgroundTransparency = 1
- mobileFrame.Parent = mainFrame
- local upBtn = Instance.new("TextButton")
- upBtn.Size = UDim2.new(0.48, 0, 1, 0)
- upBtn.Position = UDim2.new(0, 0, 0, 0)
- upBtn.BackgroundColor3 = Color3.fromRGB(52, 152, 219)
- upBtn.Text = "ASCEND (▲)"
- upBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- upBtn.TextSize = 11
- upBtn.Font = Enum.Font.GothamBold
- upBtn.Parent = mobileFrame
- local upCorner = Instance.new("UICorner")
- upCorner.CornerRadius = UDim.new(0, 6)
- upCorner.Parent = upBtn
- local downBtn = Instance.new("TextButton")
- downBtn.Size = UDim2.new(0.48, 0, 1, 0)
- downBtn.Position = UDim2.new(0.52, 0, 0, 0)
- downBtn.BackgroundColor3 = Color3.fromRGB(155, 89, 182)
- downBtn.Text = "DESCEND (▼)"
- downBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- downBtn.TextSize = 11
- downBtn.Font = Enum.Font.GothamBold
- downBtn.Parent = mobileFrame
- local downCorner = Instance.new("UICorner")
- downCorner.CornerRadius = UDim.new(0, 6)
- downCorner.Parent = downBtn
- --------------------------------------------------------------------------------
- -- SPEED LOGIC
- --------------------------------------------------------------------------------
- local function updateSpeedDisplay()
- displaySpeed = math.clamp(displaySpeed, minSpeed, maxSpeed)
- speedBox.Text = "Speed: " .. tostring(displaySpeed)
- end
- decBtn.MouseButton1Click:Connect(function()
- displaySpeed = displaySpeed - 5
- updateSpeedDisplay()
- end)
- incBtn.MouseButton1Click:Connect(function()
- displaySpeed = displaySpeed + 5
- updateSpeedDisplay()
- end)
- speedBox.FocusLost:Connect(function()
- local num = tonumber(speedBox.Text:match("%d+"))
- if num then
- displaySpeed = num
- end
- updateSpeedDisplay()
- end)
- --------------------------------------------------------------------------------
- -- FLIGHT LOGIC
- --------------------------------------------------------------------------------
- local function enableFlight()
- character = LocalPlayer.Character
- if not character then return end
- root = character:FindFirstChild("HumanoidRootPart")
- human = character:FindFirstChildOfClass("Humanoid")
- if not root or not human then return end
- attachment = Instance.new("Attachment")
- attachment.Name = "FlyAttachment"
- attachment.Parent = root
- linearVelocity = Instance.new("LinearVelocity")
- linearVelocity.Attachment0 = attachment
- linearVelocity.MaxForce = 9e9
- linearVelocity.VectorVelocity = Vector3.zero
- linearVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
- linearVelocity.Parent = root
- alignOrientation = Instance.new("AlignOrientation")
- alignOrientation.Attachment0 = attachment
- alignOrientation.MaxTorque = 9e9
- alignOrientation.Responsiveness = 200
- alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
- alignOrientation.Parent = root
- human.PlatformStand = true
- isFlying = true
- flyBtn.Text = "DISABLE FLY"
- flyBtn.BackgroundColor3 = Color3.fromRGB(231, 76, 60)
- end
- local function disableFlight()
- isFlying = false
- if human then
- human.PlatformStand = false
- end
- if linearVelocity then linearVelocity:Destroy() end
- if alignOrientation then alignOrientation:Destroy() end
- if attachment then attachment:Destroy() end
- flyBtn.Text = "ENABLE FLY"
- flyBtn.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
- end
- flyBtn.MouseButton1Click:Connect(function()
- if isFlying then
- disableFlight()
- else
- enableFlight()
- end
- end)
- -- Mobile Manual Altitude Buttons
- upBtn.MouseButton1Down:Connect(function() mobileAscend = 1 end)
- upBtn.MouseButton1Up:Connect(function() mobileAscend = 0 end)
- downBtn.MouseButton1Down:Connect(function() mobileAscend = -1 end)
- downBtn.MouseButton1Up:Connect(function() mobileAscend = 0 end)
- -- Keyboard Shortcut (PC)
- UserInputService.InputBegan:Connect(function(input, gpe)
- if gpe then return end
- if input.KeyCode == Enum.KeyCode.E then
- if isFlying then disableFlight() else enableFlight() end
- end
- end)
- -- Main Render Loop
- RunService.RenderStepped:Connect(function()
- if not isFlying or not root or not human then return end
- -- Calculated actual physics speed
- local actualSpeed = displaySpeed * SPEED_MULTIPLIER
- local moveDirection = human.MoveDirection
- local cameraCFrame = Camera.CFrame
- local finalVelocity = Vector3.zero
- -- Camera direction vector calculation
- if moveDirection.Magnitude > 0 then
- local localCamDirection = Camera.CFrame:VectorToObjectSpace(moveDirection)
- finalVelocity = (cameraCFrame:VectorToWorldSpace(
- Vector3.new(localCamDirection.X, 0, localCamDirection.Z)
- )) * actualSpeed
- end
- -- Direct Vertical Adjustments
- if mobileAscend ~= 0 then
- finalVelocity = Vector3.new(finalVelocity.X, mobileAscend * actualSpeed, finalVelocity.Z)
- elseif UserInputService:IsKeyDown(Enum.KeyCode.Space) then
- finalVelocity = Vector3.new(finalVelocity.X, actualSpeed, finalVelocity.Z)
- elseif UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then
- finalVelocity = Vector3.new(finalVelocity.X, -actualSpeed, finalVelocity.Z)
- end
- linearVelocity.VectorVelocity = finalVelocity
- alignOrientation.CFrame = cameraCFrame
- end)
- LocalPlayer.CharacterAdded:Connect(function()
- disableFlight()
- end)
RAW Paste Data
Copied
