Advertisement
YourMain12

Fly script

May 4th, 2023
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local Fly = Instance.new("BodyForce")
  4. local Torso = Player.Character:FindFirstChild("HumanoidRootPart")
  5.  
  6. Fly.force = Vector3.new(0, 0, 0)
  7. Fly.Parent = Torso
  8.  
  9. local function start()
  10.     local vel = Instance.new("BodyVelocity")
  11.     vel.velocity = Vector3.new(0, 50, 0)
  12.     vel.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  13.     vel.Parent = Torso
  14.     repeat wait()
  15.         if not Player.Character or not Player.Character:FindFirstChild("HumanoidRootPart") then break end
  16.         Fly.force = Vector3.new(0, 7500, 0)
  17.         Torso.CFrame = Torso.CFrame * CFrame.new(0, 0, -1)
  18.     until not Fly or not Torso or not Player.Character or not Player.Character:FindFirstChild("HumanoidRootPart")
  19. end
  20.  
  21. local function stop()
  22.     Fly.force = Vector3.new(0, 0, 0)
  23.     Torso.Velocity = Vector3.new(0, 0, 0)
  24. end
  25.  
  26. Mouse.KeyDown:connect(function(key)
  27.     if key == "f" then
  28.         start()
  29.     elseif key == "x" then
  30.         stop()
  31.     end
  32. end)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement