Advertisement
Guest User

JL's Jetpack Solution

a guest
Apr 9th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local CAS = game:GetService("ContextActionService")
  2.  
  3. local player = game.Players.LocalPlayer
  4. local character = player.Character or player.CharacterAdded:Wait()
  5.  
  6. local thruster = Instance.new("BodyVelocity")
  7. thruster.Velocity = Vector3.new(0, 20, 0)
  8. thruster.MaxForce = Vector3.new()
  9. thruster.Parent = character.HumanoidRootPart
  10.  
  11. local jetpack_on = false
  12.  
  13. local function jetpack()
  14.     jetpack_on = not jetpack_on
  15.     print("Jetpack:", jetpack_on)
  16.     if jetpack_on then
  17.         thruster.MaxForce = Vector3.new(0, 5000, 0)
  18.         return
  19.     end
  20.     thruster.MaxForce = Vector3.new()
  21. end
  22.  
  23. CAS:BindAction("Jetpack", jetpack, false, Enum.KeyCode.LeftControl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement