Fly
Key RequiredUniversal

Fly

Universal ScriptAjnurHubAjnurHub 371 views 349 executesUpdated Jun 30, 2026
Unrated
00
Lua Script•111 lines (3789 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer

local ScreenGui = Instance.new("ScreenGui")
local MainFrame = Instance.new("Frame")
local ToggleButton = Instance.new("TextButton")
local SpeedInput = Instance.new("TextBox")

ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
ScreenGui.ResetOnSpawn = false

MainFrame.Size = UDim2.new(0, 160, 0, 110)
MainFrame.Position = UDim2.new(0.1, 0, 0.4, 0)
MainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
MainFrame.Active = true
MainFrame.Parent = ScreenGui

ToggleButton.Size = UDim2.new(0, 140, 0, 35)
ToggleButton.Position = UDim2.new(0, 10, 0, 10)
ToggleButton.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
ToggleButton.Text = "Fly: OFF"
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Font = Enum.Font.SourceSansBold
ToggleButton.TextSize = 16
ToggleButton.Parent = MainFrame

SpeedInput.Size = UDim2.new(0, 140, 0, 35)
SpeedInput.Position = UDim2.new(0, 10, 0, 55)
SpeedInput.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
SpeedInput.Text = "50"
SpeedInput.TextColor3 = Color3.fromRGB(255, 255, 255)
SpeedInput.Font = Enum.Font.SourceSans
SpeedInput.TextSize = 16
SpeedInput.Parent = MainFrame

local isFlying = false
local flySpeed = 50
local flyConnection

local function updateFlying()
    if not isFlying then return end
    
    local character = LocalPlayer.Character
    if not character then return end
    local rootPart = character:FindFirstChild("HumanoidRootPart")
    local camera = workspace.CurrentCamera
    
    if rootPart and camera then
        local moveDirection = Vector3.new(0, 0, 0)
        
        if UserInputService:IsKeyDown(Enum.KeyCode.W) then
            moveDirection = moveDirection + camera.CFrame.LookVector
        end
        if UserInputService:IsKeyDown(Enum.KeyCode.S) then
            moveDirection = moveDirection - camera.CFrame.LookVector
        end
        if UserInputService:IsKeyDown(Enum.KeyCode.A) then
            moveDirection = moveDirection - camera.CFrame.RightVector
        end
        if UserInputService:IsKeyDown(Enum.KeyCode.D) then
            moveDirection = moveDirection + camera.CFrame.RightVector
        end
        
        if moveDirection.Magnitude > 0 then
            moveDirection = moveDirection.Unit
            rootPart.Velocity = Vector3.new(0, 0, 0)
            rootPart.CFrame = rootPart.CFrame + (moveDirection * (flySpeed * RunService.RenderStepped:Wait()))
        else
            rootPart.Velocity = Vector3.new(0, 0, 0)
        end
    end
end

ToggleButton.MouseButton1Click:Connect(function()
    isFlying = not isFlying
    if isFlying then
        ToggleButton.Text = "Fly: ON"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(40, 180, 40)
        
        local character = LocalPlayer.Character
        if character and character:FindFirstChild("Humanoid") then
            character.Humanoid.PlatformStand = true
        end
        
        flyConnection = RunService.RenderStepped:Connect(updateFlying)
    else
        ToggleButton.Text = "Fly: OFF"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
        
        if flyConnection then
            flyConnection:Disconnect()
            flyConnection = nil
        end
        
        local character = LocalPlayer.Character
        if character and character:FindFirstChild("Humanoid") then
            character.Humanoid.PlatformStand = false
        end
    end
end)

SpeedInput.FocusLost:Connect(function()
    local numericValue = tonumber(SpeedInput.Text)
    if numericValue then
        flySpeed = numericValue
    else
        SpeedInput.Text = tostring(flySpeed)
    end
end)

Features & Information

Just flyin you can turn off and on and adjust ur speed

Community Comments (1)

AjnurHubAjnurHubJul 7, 2026

Guys tell me if i need something to fix or add

More Scripts for Universal Scripts