Simple Fly Script
Key RequiredUniversal

Simple Fly Script

Universal Scriptziynet7bfkv0akinciziynet7bfkv0akinci 1.8K views 4.1K executesUpdated Jun 13, 2026
0.0/ 5(1 votes)
010% Positive
Lua Script•69 lines (1614 chars)
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

local flying = false
local speed = 75

local bodyVelocity
local bodyGyro

local function startFlying()
	if flying then return end
	flying = true

	bodyVelocity = Instance.new("BodyVelocity")
	bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	bodyVelocity.Parent = rootPart

	bodyGyro = Instance.new("BodyGyro")
	bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
	bodyGyro.P = 10000
	bodyGyro.Parent = rootPart

	humanoid.PlatformStand = true

	RunService:BindToRenderStep("Fly", Enum.RenderPriority.Character.Value, function()
		if not flying then return end

		local camera = workspace.CurrentCamera
		local moveDirection = humanoid.MoveDirection

		bodyVelocity.Velocity = moveDirection * speed
		bodyGyro.CFrame = camera.CFrame
	end)
end

local function stopFlying()
	if not flying then return end
	flying = false

	RunService:UnbindFromRenderStep("Fly")

	if bodyVelocity then
		bodyVelocity:Destroy()
	end

	if bodyGyro then
		bodyGyro:Destroy()
	end

	humanoid.PlatformStand = false
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end

	if input.KeyCode == Enum.KeyCode.F then
		if flying then
			stopFlying()
		else
			startFlying()
		end
	end
end)

Features & Information

Simple Fly Script

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts