Universal Script πŸ“Œ
82.3k Views
116 Executions

Fly

Universal Script πŸ“Œ
Tbao
Tbao1M views
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Script

View Raw
-- Place this script in a LocalScript (for client-side)

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local flying = true -- Set to true to enable flying
local flySpeed = 50 -- Adjust fly speed as needed

-- Function to handle flying
local function startFlying()
    local bodyGyro = Instance.new("BodyGyro")
    local bodyVelocity = Instance.new("BodyVelocity")

    bodyGyro.P = 9e4
    bodyGyro.maxTorque = Vector3.new(9e4, 9e4, 9e4)
    bodyGyro.cframe = humanoidRootPart.CFrame
    bodyGyro.Parent = humanoidRootPart

    bodyVelocity.velocity = Vector3.new(0, 0, 0)
    bodyVelocity.maxForce = Vector3.new(9e4, 9e4, 9e4)
    bodyVelocity.Parent = humanoidRootPart

    while flying do
        humanoidRootPart.CFrame = humanoidRootPart.CFrame
        bodyGyro.cframe = workspace.CurrentCamera.CFrame
        bodyVelocity.velocity = workspace.CurrentCamera.CFrame.LookVector * flySpeed

        local moveDirection = Vector3.new()
        local camera = workspace.CurrentCamera
        local cameraCFrame = camera.CFrame

        -- WASD controls for movement
        if player.Character.Humanoid.MoveDirection.Magnitude > 0 then
            moveDirection = cameraCFrame:VectorToWorldSpace(Vector3.new(player.Character.Humanoid.MoveDirection.X, 0, player.Character.Humanoid.MoveDirection.Z))
        end

        bodyVelocity.velocity = moveDirection * flySpeed



Comments

1
Log in to join the conversation. Login
hiexe's profile picture
hiexe2 years ago(edited)

chatgpt ahh codeπŸ’€ "Place this script in a LocalScript (for client-side)"

1

More universal scripts

See all
Universal Script πŸ“Œ
3.9k
184.5k
Bumped 5 hours ago
Script hub
470
44
6 hours ago
Universal Script πŸ“Œ
28.7k
663.4k
Bumped 7 hours ago
Script hub
13.9k
2.7k
Bumped 10 hours ago
Key System
Paid
Script hub
263.8k
88.2k
Bumped 10 hours ago
Key System
Universal Script πŸ“Œ
3.0k
9.5k
Bumped 11 hours ago
Universal Script πŸ“Œ
727
42
Approved 11 hours ago
Universal Script πŸ“Œ
761
43
Approved 11 hours ago