local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local speed = 50 local flying = false local gui = Instance.new("ScreenGui") gui.Name = "ModernFlyGUI" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(280, 245) frame.Position = UDim2.new(0.5, -140, 0.5, -122) frame.BackgroundColor3 = Color3.fromRGB(19, 20, 30) frame.Parent = gui Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 14) local stroke = Instance.new("UIStroke", frame) stroke.Color = Color3.fromRGB(100, 80, 255) stroke.Thickness = 2 -- DRAGGING local dragging = false local dragStart, startPos local topbar = Instance.new("Frame") topbar.Size = UDim2.new(1, 0, 0, 45) topbar.BackgroundColor3 = Color3.fromRGB(30, 31, 48) topbar.Parent = frame Instance.new("UICorner", topbar).CornerRadius = UDim.new(0, 14) local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -60, 1, 0) title.Position = UDim2.fromOffset(15, 0) title.BackgroundTransparency = 1 title.Text = "✈ FLY CONTROL" title.TextColor3 = Color3.fromRGB(255,255,255) title.Font = Enum.Font.GothamBold title.TextSize = 17 title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = topbar topbar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = input.Position startPos = frame.Position end end) UIS.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local delta = input.Position - dragStart frame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) UIS.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) local function makeButton(text, position, size) local b = Instance.new("TextButton") b.Size = size b.Position = position b.BackgroundColor3 = Color3.fromRGB(42, 44, 65) b.Text = text b.TextColor3 = Color3.new(1,1,1) b.Font = Enum.Font.GothamBold b.TextSize = 14 b.AutoButtonColor = true b.Parent = frame Instance.new("UICorner", b).CornerRadius = UDim.new(0, 9) return b end local flyButton = makeButton("FLY OFF", UDim2.fromOffset(20,65), UDim2.new(1,-40,0,42)) flyButton.BackgroundColor3 = Color3.fromRGB(170,55,65) local speedLabel = Instance.new("TextLabel") speedLabel.Size = UDim2.new(1,-40,0,25) speedLabel.Position = UDim2.fromOffset(20,120) speedLabel.BackgroundTransparency = 1 speedLabel.Text = "FLIGHT SPEED: 50" speedLabel.TextColor3 = Color3.fromRGB(210,210,230) speedLabel.Font = Enum.Font.GothamBold speedLabel.TextSize = 13 speedLabel.Parent = frame local minus = makeButton("-", UDim2.fromOffset(20,155), UDim2.fromOffset(65,38)) local plus = makeButton("+", UDim2.new(1,-85,0,155), UDim2.fromOffset(65,38)) local close = makeButton("CLOSE", UDim2.fromOffset(20,205), UDim2.new(1,-40,0,28)) close.BackgroundColor3 = Color3.fromRGB(150,45,55) local velocity, gyro, connection local function stopFlying() flying = false if connection then connection:Disconnect() connection = nil end if velocity then velocity:Destroy() velocity = nil end if gyro then gyro:Destroy() gyro = nil end local char = player.Character if char then local hum = char:FindFirstChildOfClass("Humanoid") if hum then hum.PlatformStand = false end end flyButton.Text = "FLY OFF" flyButton.BackgroundColor3 = Color3.fromRGB(170,55,65) end local function startFlying() local char = player.Character if not char then return end local root = char:FindFirstChild("HumanoidRootPart") local hum = char:FindFirstChildOfClass("Humanoid") if not root or not hum then return end flying = true hum.PlatformStand = true velocity = Instance.new("BodyVelocity") velocity.MaxForce = Vector3.new(1e9,1e9,1e9) velocity.Velocity = Vector3.zero velocity.Parent = root gyro = Instance.new("BodyGyro") gyro.MaxTorque = Vector3.new(1e9,1e9,1e9) gyro.P = 10000 gyro.Parent = root flyButton.Text = "FLY ON" flyButton.BackgroundColor3 = Color3.fromRGB(40,170,110) connection = RunService.RenderStepped:Connect(function() if not flying or not root.Parent then stopFlying() return end local camera = workspace.CurrentCamera local dir = Vector3.zero if UIS:IsKeyDown(Enum.KeyCode.W) then dir += camera.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= camera.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.A) then dir -= camera.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.D) then dir += camera.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.Space) then dir += Vector3.yAxis end if UIS:IsKeyDown(Enum.KeyCode.LeftControl) then dir -= Vector3.yAxis end velocity.Velocity = dir * speed gyro.CFrame = camera.CFrame end) end flyButton.MouseButton1Click:Connect(function() if flying then stopFlying() else startFlying() end end) plus.MouseButton1Click:Connect(function() speed = math.min(speed + 25, 300) speedLabel.Text = "FLIGHT SPEED: " .. speed end) minus.MouseButton1Click:Connect(function() speed = math.max(speed - 25, 25) speedLabel.Text = "FLIGHT SPEED: " .. speed end) close.MouseButton1Click:Connect(function() stopFlying() gui:Destroy() end)