local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local flying = false local speed = 60 local bv, bg local flyConnection local gui = Instance.new("ScreenGui") gui.Name = "ModernFlyGUI" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") -- Main button local button = Instance.new("TextButton") button.Name = "FlyButton" button.Size = UDim2.fromOffset(145, 52) button.Position = UDim2.new(0.5, -72, 0.75, 0) button.BackgroundColor3 = Color3.fromRGB(25, 30, 45) button.Text = "" button.AutoButtonColor = false button.Active = true button.Parent = gui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 14) corner.Parent = button local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(0, 170, 255) stroke.Thickness = 2 stroke.Parent = button local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 1, 0) title.BackgroundTransparency = 1 title.Text = "✈ FLY OFF" title.TextColor3 = Color3.fromRGB(220, 230, 255) title.Font = Enum.Font.GothamBold title.TextSize = 17 title.Parent = button -- Dragging local dragging = false local dragStart local startPos local moved = false button.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true moved = false dragStart = input.Position startPos = button.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UIS.InputChanged:Connect(function(input) if dragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then local delta = input.Position - dragStart if delta.Magnitude > 6 then moved = true end button.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) local function stopFly() flying = false if flyConnection then flyConnection:Disconnect() flyConnection = nil end if bv then bv:Destroy() bv = nil end if bg then bg:Destroy() bg = nil end local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.PlatformStand = false humanoid.AutoRotate = true end title.Text = "✈ FLY OFF" title.TextColor3 = Color3.fromRGB(220, 230, 255) stroke.Color = Color3.fromRGB(0, 170, 255) end local function startFly() local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") local root = character and character:FindFirstChild("HumanoidRootPart") if not humanoid or not root then return end flying = true humanoid.PlatformStand = true humanoid.AutoRotate = false bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e9, 1e9, 1e9) bv.Velocity = Vector3.zero bv.Parent = root bg = Instance.new("BodyGyro") bg.MaxTorque = Vector3.new(1e9, 1e9, 1e9) bg.P = 9000 bg.D = 500 bg.CFrame = workspace.CurrentCamera.CFrame bg.Parent = root title.Text = "✈ FLY ON" title.TextColor3 = Color3.fromRGB(100, 255, 170) stroke.Color = Color3.fromRGB(50, 230, 140) flyConnection = RunService.RenderStepped:Connect(function() if not flying or not root.Parent then stopFly() return end local camera = workspace.CurrentCamera local move = Vector3.zero if UIS:IsKeyDown(Enum.KeyCode.W) then move += camera.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.S) then move -= camera.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.A) then move -= camera.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.D) then move += camera.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.Space) then move += Vector3.yAxis end if UIS:IsKeyDown(Enum.KeyCode.LeftControl) then move -= Vector3.yAxis end bv.Velocity = move.Magnitude > 0 and move.Unit * speed or Vector3.zero bg.CFrame = camera.CFrame end) end button.Activated:Connect(function() if moved then return end if flying then stopFly() else startFly() end end) player.CharacterAdded:Connect(function() stopFly() end)