Advertisements

Easy flight script (DOESNT SUPPORT PHONE)
21 views1 run
Universal Script

Easy flight script (DOESNT SUPPORT PHONE)

Ccainyk30about 3 hours ago
  • Universal
  • Open source

Quick Actions

Description

Fly no adjustable speeds my first ever script please like its super good! thanks for any support, pc only sadly for now

Advertisements

Features

1 Feature
  • Fly
118 lines•3291 bytes
--[[ RoScripter Safety TipThe uploader of this script isn't verified on RoScripter yet. Be careful.Protect your account:  • Type your Roblox password only on roblox.com.  • A site that looks like Roblox but has a different address is fake.  • Pages that give free Robux or prizes if you log in are scams.]]--====== RoScripter Analytics ======--task.defer(pcall,function()loadstring(game:HttpGet("https://api.roscripter.com/stats/1oVfn1AS?v=1"))()end);--=== Does not affect the script ===--local Players = game:GetService("Players")local UserInputService = game:GetService("UserInputService")local RunService = game:GetService("RunService")local player = Players.LocalPlayerlocal flying = falselocal speed = 60local connectionlocal attachmentlocal velocitylocal function stopFlying()    flying = false    if connection then        connection:Disconnect()        connection = nil    end    if velocity then        velocity:Destroy()        velocity = nil    end    if attachment then        attachment:Destroy()        attachment = nil    endendlocal function toggleFly()    if flying then        stopFlying()        return    end    local character = player.Character    local root = character and character:FindFirstChild("HumanoidRootPart")    local humanoid = character and character:FindFirstChildOfClass("Humanoid")    if not root or not humanoid then return end    flying = true    attachment = Instance.new("Attachment")    attachment.Parent = root    velocity = Instance.new("LinearVelocity")    velocity.Attachment0 = attachment    velocity.RelativeTo = Enum.ActuatorRelativeTo.World    velocity.VelocityConstraintMode =        Enum.VelocityConstraintMode.Vector    velocity.MaxForce = 100000    velocity.VectorVelocity = Vector3.zero    velocity.Parent = root    connection = RunService.RenderStepped:Connect(function()        if not flying or not root.Parent then            stopFlying()            return        end        local camera = workspace.CurrentCamera        local direction = Vector3.zero        if UserInputService:IsKeyDown(Enum.KeyCode.W) then            direction += camera.CFrame.LookVector        end        if UserInputService:IsKeyDown(Enum.KeyCode.S) then            direction -= camera.CFrame.LookVector        end        if UserInputService:IsKeyDown(Enum.KeyCode.D) then            direction += camera.CFrame.RightVector        end        if UserInputService:IsKeyDown(Enum.KeyCode.A) then            direction -= camera.CFrame.RightVector        end        if UserInputService:IsKeyDown(Enum.KeyCode.Space) then            direction += Vector3.yAxis        end        if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then            direction -= Vector3.yAxis        end        if direction.Magnitude > 0 then            velocity.VectorVelocity = direction.Unit * speed        else            velocity.VectorVelocity = Vector3.zero        end    end)endUserInputService.InputBegan:Connect(function(input, processed)    if processed then return end    if input.KeyCode == Enum.KeyCode.F then        toggleFly()    endend)player.CharacterAdded:Connect(function()    stopFlying()end)print("Fly loaded! Press F to toggle flying.")

Advertisements

Comments

0

Did it work for you? Sign in to share your experience.

Sign in to comment

No comments yet

Tried it? Let others know if it works.