local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local rootPart = character:WaitForChild("HumanoidRootPart") -- Fly variables local flying = false local flySpeed = 50 local flyDirection = Vector3.new(0,0,0) local bodyVelocity -- Create ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "FlyMenu" screenGui.Parent = player:WaitForChild("PlayerGui") -- Create main frame local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 200, 0, 150) mainFrame.Position = UDim2.new(0, 20, 0, 20) mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) mainFrame.BorderSizePixel = 0 mainFrame.Parent = screenGui mainFrame.Active = true mainFrame.Draggable = true -- Title local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundColor3 = Color3.fromRGB(45, 45, 45) title.BorderSizePixel = 0 title.Text = "Fly Menu" title.TextColor3 = Color3.new(1,1,1) title.Font = Enum.Font.SourceSansBold title.TextSize = 20 title.Parent = mainFrame -- Fly toggle button local flyButton = Instance.new("TextButton") flyButton.Size = UDim2.new(0, 160, 0, 40) flyButton.Position = UDim2.new(0, 20, 0, 50) flyButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70) flyButton.BorderSizePixel = 0 flyButton.Text = "Toggle Fly: OFF" flyButton.TextColor3 = Color3.new(1,1,1) flyButton.Font = Enum.Font.SourceSansBold flyButton.TextSize = 18 flyButton.Parent = mainFrame -- Speed slider label local speedLabel = Instance.new("TextLabel") speedLabel.Size = UDim2.new(0, 160, 0, 20) speedLabel.Position = UDim2.new(0, 20, 0, 100) speedLabel.BackgroundTransparency = 1 speedLabel.Text = "Fly Speed: 50" speedLabel.TextColor3 = Color3.new(1,1,1) speedLabel.Font = Enum.Font.SourceSans speedLabel.TextSize = 16 speedLabel.TextXAlignment = Enum.TextXAlignment.Left speedLabel.Parent = mainFrame -- Speed slider local speedSlider = Instance.new("TextButton") speedSlider.Size = UDim2.new(0, 160, 0, 10) speedSlider.Position = UDim2.new(0, 20, 0, 125) speedSlider.BackgroundColor3 = Color3.fromRGB(100, 100, 100) speedSlider.BorderSizePixel = 0 speedSlider.Text = "" speedSlider.Parent = mainFrame local sliderFill = Instance.new("Frame") sliderFill.Size = UDim2.new(flySpeed/100, 0, 1, 0) sliderFill.BackgroundColor3 = Color3.fromRGB(0, 170, 255) sliderFill.BorderSizePixel = 0 sliderFill.Parent = speedSlider -- Fly function local function startFly() if flying then return end flying = true flyButton.Text = "Toggle Fly: ON" bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5) bodyVelocity.Velocity = Vector3.new(0,0,0) bodyVelocity.Parent = rootPart end local function stopFly() if not flying then return end flying = false flyButton.Text = "Toggle Fly: OFF" if bodyVelocity then bodyVelocity:Destroy() bodyVelocity = nil end end flyButton.MouseButton1Click:Connect(function() if flying then stopFly() else startFly() end end) -- Update fly speed from slider local dragging = false speedSlider.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true end end) speedSlider.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) speedSlider.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local relativeX = math.clamp(input.Position.X - speedSlider.AbsolutePosition.X, 0, speedSlider.AbsoluteSize.X) local percent = relativeX / speedSlider.AbsoluteSize.X flySpeed = math.floor(percent * 100) if flySpeed < 1 then flySpeed = 1 end sliderFill.Size = UDim2.new(percent, 0, 1, 0) speedLabel.Text = "Fly Speed: "..flySpeed end end) -- Movement input tracking local moveVector = Vector3.new(0,0,0) local keysDown = {} UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.W then keysDown.W = true end if input.KeyCode == Enum.KeyCode.S then keysDown.S = true end if input.KeyCode == Enum.KeyCode.A then keysDown.A = true end if input.KeyCode == Enum.KeyCode.D then keysDown.D = true end if input.KeyCode == Enum.KeyCode.Space then keysDown.Space = true end if input.KeyCode == Enum.KeyCode.LeftControl then keysDown.Ctrl = true end end) UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.KeyCode == Enum.KeyCode.W then keysDown.W = false end if input.KeyCode == Enum.KeyCode.S then keysDown.S = false end if input.KeyCode == Enum.KeyCode.A then keysDown.A = false end if input.KeyCode == Enum.KeyCode.D then keysDown.D = false end if input.KeyCode == Enum.KeyCode.Space then keysDown.Space = false end if input.KeyCode == Enum.KeyCode.LeftControl then keysDown.Ctrl = false end end) -- Update fly velocity every frame RunService.RenderStepped:Connect(function() if flying and bodyVelocity then local camCFrame = workspace.CurrentCamera.CFrame local direction = Vector3.new(0,0,0) if keysDown.W then direction = direction + camCFrame.LookVector end if keysDown.S then direction = direction - camCFrame.LookVector end if keysDown.A then direction = direction - camCFrame.RightVector end if keysDown.D then direction = direction + camCFrame.RightVector end if keysDown.Space then direction = direction + Vector3.new(0,1,0) end if keysDown.Ctrl then direction = direction - Vector3.new(0,1,0) end if direction.Magnitude > 0 then direction = direction.Unit * flySpeed end bodyVelocity.Velocity = direction end end)