Advertisement
TheJagExploits

Untitled

Apr 10th, 2020
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. local toggle = false
  2. Fly.MouseButton1Click:Connect(function()
  3. toggle = not toggle
  4. Fly.TextColor3 = (toggle and Color3.fromRGB(85, 255, 127) or Color3.fromRGB(255,255,255))
  5. if toggle then
  6. flying = not flying
  7. repeat wait()
  8. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  9. local mouse = game.Players.LocalPlayer:GetMouse()
  10. repeat wait() until mouse
  11. local plr = game.Players.LocalPlayer
  12. local torso = plr.Character.Torso
  13. local deb = true
  14. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  15. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  16. local maxspeed = 200
  17. local speed = 0
  18. if flying then
  19. end
  20.  
  21. function FlyFunction()
  22. local bg = Instance.new("BodyGyro", torso)
  23. bg.P = 9e4
  24. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  25. bg.cframe = torso.CFrame
  26. local bv = Instance.new("BodyVelocity", torso)
  27. bv.velocity = Vector3.new(0,0.1,0)
  28. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  29. repeat wait()
  30. plr.Character.Humanoid.PlatformStand = true
  31. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  32. speed = speed+.5+(speed/maxspeed)
  33. if speed > maxspeed then
  34. speed = maxspeed
  35. end
  36. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  37. speed = speed-1
  38. if speed < 0 then
  39. speed = 0
  40. end
  41. end
  42. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  43. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  44. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  45. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  46. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  47. else
  48. bv.velocity = Vector3.new(0,0.1,0)
  49. end
  50. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  51. until not flying
  52. ctrl = {f = 0, b = 0, l = 0, r = 0}
  53. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  54. speed = 0
  55. bg:Destroy()
  56. bv:Destroy()
  57. plr.Character.Humanoid.PlatformStand = false
  58. end
  59. mouse.KeyDown:connect(function(key)
  60. if key:lower() == "w" then
  61. ctrl.f = 1
  62. elseif key:lower() == "s" then
  63. ctrl.b = -1
  64. elseif key:lower() == "a" then
  65. ctrl.l = -1
  66. elseif key:lower() == "d" then
  67. ctrl.r = 1
  68.  
  69. end
  70. end)
  71. mouse.KeyUp:connect(function(key)
  72. if key:lower() == "w" then
  73. ctrl.f = 0
  74. elseif key:lower() == "s" then
  75. ctrl.b = 0
  76. elseif key:lower() == "a" then
  77. ctrl.l = 0
  78. elseif key:lower() == "d" then
  79. ctrl.r = 0
  80. end
  81. end)
  82. FlyFunction()
  83. else
  84. flying = not flying
  85. repeat wait()
  86. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  87. local mouse = game.Players.LocalPlayer:GetMouse()
  88. repeat wait() until mouse
  89. local plr = game.Players.LocalPlayer
  90. local torso = plr.Character.Torso
  91. local deb = true
  92. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  93. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  94. local maxspeed = 200
  95. local speed = 0
  96. if flying then
  97. end
  98.  
  99. function FlyFunction()
  100. local bg = Instance.new("BodyGyro", torso)
  101. bg.P = 9e4
  102. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  103. bg.cframe = torso.CFrame
  104. local bv = Instance.new("BodyVelocity", torso)
  105. bv.velocity = Vector3.new(0,0.1,0)
  106. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  107. repeat wait()
  108. plr.Character.Humanoid.PlatformStand = true
  109. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  110. speed = speed+.5+(speed/maxspeed)
  111. if speed > maxspeed then
  112. speed = maxspeed
  113. end
  114. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  115. speed = speed-1
  116. if speed < 0 then
  117. speed = 0
  118. end
  119. end
  120. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  121. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  122. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  123. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  124. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  125. else
  126. bv.velocity = Vector3.new(0,0.1,0)
  127. end
  128. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  129. until not flying
  130. ctrl = {f = 0, b = 0, l = 0, r = 0}
  131. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  132. speed = 0
  133. bg:Destroy()
  134. bv:Destroy()
  135. plr.Character.Humanoid.PlatformStand = false
  136. end
  137. mouse.KeyDown:connect(function(key)
  138. if key:lower() == "w" then
  139. ctrl.f = 1
  140. elseif key:lower() == "s" then
  141. ctrl.b = -1
  142. elseif key:lower() == "a" then
  143. ctrl.l = -1
  144. elseif key:lower() == "d" then
  145. ctrl.r = 1
  146.  
  147. end
  148. end)
  149. mouse.KeyUp:connect(function(key)
  150. if key:lower() == "w" then
  151. ctrl.f = 0
  152. elseif key:lower() == "s" then
  153. ctrl.b = 0
  154. elseif key:lower() == "a" then
  155. ctrl.l = 0
  156. elseif key:lower() == "d" then
  157. ctrl.r = 0
  158. end
  159. end)
  160. FlyFunction()
  161. end
  162. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement