Advertisement
HenloMyDude

jetpack

Dec 13th, 2019
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2. ezweld = function(p, a, b, cf)
  3. local weld = Instance.new("Weld",p)
  4. weld.Part0 = a
  5. weld.Part1 = b
  6. weld.C0 = cf
  7. return weld
  8. end
  9.  
  10. plr = owner
  11. char = plr.Character
  12. root = char.HumanoidRootPart
  13. hum = char.Humanoid
  14. hold = false
  15.  
  16. local bv = Instance.new("BodyVelocity",nil)
  17.  
  18. local remote = Instance.new("RemoteEvent",char)
  19. remote.Name = "remote"
  20.  
  21. local jet = Instance.new("Part",char)
  22. local fire = Instance.new("Fire",nil)
  23. fire.Enabled = true
  24.  
  25. if char:FindFirstChild("Torso") then
  26. jet.CanCollide = false
  27. jet.Size = Vector3.new(5, 3, 1)
  28. local mesh = Instance.new("SpecialMesh",jet)
  29. mesh.MeshId = "http://www.roblox.com/asset/?id=30643517"
  30. mesh.TextureId = "http://www.roblox.com/asset/?id=30643565"
  31. local weld = ezweld(char, jet, char.Torso, CFrame.new(0, -0.25, -0.75))
  32. elseif char:FindFirstChild("UpperTorso") then
  33. jet.CanCollide = false
  34. jet.Size = Vector3.new(5, 3, 1)
  35. local mesh = Instance.new("SpecialMesh",jet)
  36. mesh.MeshId = "http://www.roblox.com/asset/?id=30643517"
  37. mesh.TextureId = "http://www.roblox.com/asset/?id=30643565"
  38. local weld = ezweld(char, jet, char.UpperTorso, CFrame.new(0, 0, -0.75))
  39. end
  40.  
  41. function lol(Key)
  42. if Key == "flighton" then
  43. hold = true
  44. repeat
  45. wait()
  46. fire.Parent = jet
  47. bv.Parent = root
  48. bv.MaxForce = Vector3.new(0, math.huge, 0)
  49. bv.Velocity = Vector3.new(0, 25, 0)
  50. until hold == false
  51. fire.Parent = nil
  52. bv.Parent = nil
  53. end
  54. if Key == "flightoff" then
  55. hold = false
  56. fire.Parent = nil
  57. end
  58. end
  59.  
  60. NLS([[
  61.  
  62. plr = owner
  63. char = plr.Character
  64. remote = char.remote
  65. mouse = plr:GetMouse()
  66.  
  67. mouse.KeyDown:connect(function(key)
  68. if key == " " then
  69. remote:FireServer("flighton")
  70. end
  71. end)
  72.  
  73. mouse.KeyUp:connect(function(key)
  74. if key == " " then
  75. remote:FireServer("flightoff")
  76. end
  77. end)
  78.  
  79. ]], char)
  80.  
  81. remote.OnServerEvent:connect(function(PlayerSendit, Button) lol(Button) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement