Fly
Key RequiredUniversal

Fly

Universal Scriptpatjax774patjax774 875 views 173 executesUpdated Dec 18, 2025
Unrated
00
Lua Script•126 lines (4033 chars)
loadstring([[
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")

-- Create GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "FlyMenu"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 200, 0, 100)
frame.Position = UDim2.new(0, 50, 0, 50)
frame.BackgroundColor3 = Color3.fromRGB(40,40,40)
frame.BorderSizePixel = 0
frame.Visible = false -- start hidden
frame.Parent = screenGui

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1,0,0,30)
title.Position = UDim2.new(0,0,0,0)
title.BackgroundColor3 = Color3.fromRGB(20,20,20)
title.Text = "Fly Menu"
title.TextColor3 = Color3.new(1,1,1)
title.Parent = frame

-- Fly button
local flyButton = Instance.new("TextButton")
flyButton.Size = UDim2.new(0.8,0,0,40)
flyButton.Position = UDim2.new(0.1,0,0.5,0)
flyButton.BackgroundColor3 = Color3.fromRGB(70,70,70)
flyButton.TextColor3 = Color3.new(1,1,1)
flyButton.Text = "Fly: OFF"
flyButton.Parent = frame

-- Variables
local flying = false
local bodyVelocity

-- Toggle Fly
flyButton.MouseButton1Click:Connect(function()
    flying = not flying
    flyButton.Text = flying and "Fly: ON" or "Fly: OFF"
    
    local character = player.Character
    if not character then return end
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if not hrp then return end

    if flying then
        bodyVelocity = Instance.new("BodyVelocity")
        bodyVelocity.MaxForce = Vector3.new(400000,400000,400000)
        bodyVelocity.Velocity = Vector3.new(0,0,0)
        bodyVelocity.Parent = hrp

        local conn
        conn = runService.RenderStepped:Connect(function()
            if not flying then
                conn:Disconnect()
                bodyVelocity:Destroy()
                return
            end
            local dir = Vector3.new(0,0,0)
            if userInputService:IsKeyDown(Enum.KeyCode.W) then dir = dir + hrp.CFrame.LookVector end
            if userInputService:IsKeyDown(Enum.KeyCode.S) then dir = dir - hrp.CFrame.LookVector end
            if userInputService:IsKeyDown(Enum.KeyCode.A) then dir = dir - hrp.CFrame.RightVector end
            if userInputService:IsKeyDown(Enum.KeyCode.D) then dir = dir + hrp.CFrame.RightVector end
            if userInputService:IsKeyDown(Enum.KeyCode.Space) then dir = dir + Vector3.new(0,1,0) end
            if userInputService:IsKeyDown(Enum.KeyCode.LeftShift) then dir = dir - Vector3.new(0,1,0) end
            bodyVelocity.Velocity = dir * 50
        end)
    else
        if bodyVelocity then
            bodyVelocity:Destroy()
        end
    end
end)

-- Toggle menu visibility with Insert key
userInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.Insert then
        frame.Visible = not frame.Visible
    end
end)

-- Make GUI draggable
local dragging = false
local dragInput
local dragStart
local startPos

local function update(input)
    local delta = input.Position - dragStart
    frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
                               startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end

title.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        dragging = true
        dragStart = input.Position
        startPos = frame.Position

        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragging = false
            end
        end)
    end
end)

title.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        dragInput = input
    end
end)

userInputService.InputChanged:Connect(function(input)
    if input == dragInput and dragging then
        update(input)
    end
end)
]])()

Features & Information

flying press insert to open and close the menu

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts