-- LocalScript (StarterPlayerScripts) local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") -- Change walkspeed to 50 humanoid.WalkSpeed = 50 -- Fly variables local flying = false local speed = 50 local velocity = Instance.new("BodyVelocity") local gyro = Instance.new("BodyGyro") local direction = Vector3.new() -- Setup fly controls local function startFlying() if flying then return end flying = true velocity.MaxForce = Vector3.new(100000, 100000, 100000) velocity.Velocity = Vector3.new(0, 0, 0) velocity.P = 1250 velocity.Parent = character.HumanoidRootPart gyro.MaxTorque = Vector3.new(400000, 400000, 400000) gyro.CFrame = character.HumanoidRootPart.CFrame gyro.P = 3000 gyro.Parent = character.HumanoidRootPart RunService.RenderStepped:Connect(function() if flying then local cam = workspace.CurrentCamera local moveDir = Vector3.new() if UIS:IsKeyDown(Enum.KeyCode.W) then moveDir += cam.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.S) then moveDir -= cam.CFrame.LookVector end if UIS:IsKeyDown(Enum.KeyCode.A) then moveDir -= cam.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.D) then moveDir += cam.CFrame.RightVector end if UIS:IsKeyDown(Enum.KeyCode.Space) then moveDir += cam.CFrame.UpVector end if UIS:IsKeyDown(Enum.KeyCode.LeftControl) then moveDir -= cam.CFrame.UpVector end moveDir = moveDir.Unit * speed if moveDir.Magnitude ~= moveDir.Magnitude then moveDir = Vector3.new() end velocity.Velocity = moveDir gyro.CFrame = cam.CFrame end end) end local function stopFlying() flying = false velocity:Destroy() gyro:Destroy() end -- Toggle fly with F key UIS.InputBegan:Connect(function(input, isTyping) if isTyping then return end if input.KeyCode == Enum.KeyCode.F then if flying then stopFlying() else startFlying() end end end)