-- ============================== -- Robust Roblox Fly Script -- ============================== local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local hrp = character:WaitForChild("HumanoidRootPart") local humanoid = character:WaitForChild("Humanoid") local flying = false local flySpeed = 50 -- Key states local keys = {W=false, A=false, S=false, D=false, Space=false, Shift=false} -- Toggle fly with F UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.F then flying = not flying humanoid.PlatformStand = flying end if input.KeyCode == Enum.KeyCode.W then keys.W = true end if input.KeyCode == Enum.KeyCode.A then keys.A = true end if input.KeyCode == Enum.KeyCode.S then keys.S = true end if input.KeyCode == Enum.KeyCode.D then keys.D = true end if input.KeyCode == Enum.KeyCode.Space then keys.Space = true end if input.KeyCode == Enum.KeyCode.LeftShift then keys.Shift = true end end) UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.KeyCode == Enum.KeyCode.W then keys.W = false end if input.KeyCode == Enum.KeyCode.A then keys.A = false end if input.KeyCode == Enum.KeyCode.S then keys.S = false end if input.KeyCode == Enum.KeyCode.D then keys.D = false end if input.KeyCode == Enum.KeyCode.Space then keys.Space = false end if input.KeyCode == Enum.KeyCode.LeftShift then keys.Shift = false end end) -- Fly loop RunService.RenderStepped:Connect(function() if flying then local cam = workspace.CurrentCamera local moveDir = Vector3.new() if keys.W then moveDir = moveDir + cam.CFrame.LookVector end if keys.S then moveDir = moveDir - cam.CFrame.LookVector end if keys.A then moveDir = moveDir - cam.CFrame.RightVector end if keys.D then moveDir = moveDir + cam.CFrame.RightVector end if keys.Space then moveDir = moveDir + Vector3.new(0,1,0) end if keys.Shift then moveDir = moveDir - Vector3.new(0,1,0) end if moveDir.Magnitude > 0 then hrp.Velocity = moveDir.Unit * flySpeed else hrp.Velocity = Vector3.new(0,0,0) end end end)