Advertisement
ToxicTheBoss

ToolFly

Jun 23rd, 2020
45,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. -- // Config: \\ --
  2.  
  3. local tool = game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Tool"):FindFirstChild("Handle");
  4. local stopbind = "e";
  5.  
  6. -- // Main: \\ --
  7.  
  8. game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = 0;
  9.  
  10. local NetworkAccess =
  11. coroutine.create(
  12. function()
  13. settings().Physics.AllowSleep = false
  14. while true do
  15. game:GetService('RunService').Heartbeat:wait()
  16. local TBL = game:GetService("Players"):GetChildren()
  17. for key = 1, #TBL do
  18. local Players = TBL[key]
  19. if Players ~= game:GetService("Players").LocalPlayer then
  20. sethiddenproperty(Players, "SimulationRadius", 0)
  21. sethiddenproperty(game.Players.LocalPlayer, "MaximumSimulationRadius", 0)
  22.  
  23. end
  24. end
  25. end
  26. end
  27. )
  28. coroutine.resume(NetworkAccess)
  29.  
  30. sethiddenproperty(game.Players.LocalPlayer, "SimulationRadius", math.huge)
  31. sethiddenproperty(game.Players.LocalPlayer, "MaximumSimulationRadius", math.huge)
  32.  
  33. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  34. repeat
  35. wait()
  36. until mouse
  37. local plr = game:GetService("Players").LocalPlayer;
  38. workspace.CurrentCamera.CameraSubject = tool;
  39.  
  40. local flying = true
  41. local deb = true
  42. local ctrl = {
  43. f = 0,
  44. b = 0,
  45. l = 0,
  46. r = 0
  47. }
  48. local lastctrl = {
  49. f = 0,
  50. b = 0,
  51. l = 0,
  52. r = 0
  53. }
  54. local maxspeed = 50
  55. local speed = 0
  56.  
  57. function Fly()
  58. local bg = Instance.new("BodyGyro", tool)
  59. bg.P = 9e4
  60. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  61. bg.cframe = tool.CFrame
  62. local bv = Instance.new("BodyVelocity", tool)
  63. bv.velocity = Vector3.new(0, 0.1, 0)
  64. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  65.  
  66. pcall(function()
  67. for i, v in pairs(game:GetService("Players").LocalPlayer.Character:GetDescendants()) do
  68. if v.Name:find("Grip") or v.Name:find("grip") and v.Parent.Name:find("Right") then
  69. v:Destroy()
  70. end
  71. end
  72. end)
  73.  
  74. repeat
  75. wait()
  76. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  77. speed = speed + .5 + (speed / maxspeed)
  78. if speed > maxspeed then
  79. speed = maxspeed
  80. end
  81. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  82. speed = speed - 1
  83. if speed < 0 then
  84. speed = 0
  85. end
  86. end
  87. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  88. 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
  89. lastctrl = {
  90. f = ctrl.f,
  91. b = ctrl.b,
  92. l = ctrl.l,
  93. r = ctrl.r
  94. }
  95. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  96. 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
  97. else
  98. bv.velocity = Vector3.new(0, 0.1, 0)
  99. end
  100. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f + ctrl.b) * 50 * speed / maxspeed), 0, 0)
  101. until not flying
  102. ctrl = {
  103. f = 0,
  104. b = 0,
  105. l = 0,
  106. r = 0
  107. }
  108. lastctrl = {
  109. f = 0,
  110. b = 0,
  111. l = 0,
  112. r = 0
  113. }
  114. speed = 0
  115. bg:Destroy()
  116. bv:Destroy()
  117. end
  118.  
  119. mouse.KeyDown:connect(function(key)
  120. if key:lower() == stopbind then
  121. if flying then
  122. flying = false
  123. game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = 16;
  124. workspace.CurrentCamera.CameraSubject = game:GetService("Players").LocalPlayer.Character.Humanoid
  125. flying = false;
  126. else
  127. flying = true
  128. Fly()
  129. end
  130. elseif key:lower() == "e" then
  131.  
  132. elseif key:lower() == "w" then
  133. ctrl.f = 1
  134. elseif key:lower() == "s" then
  135. ctrl.b = -1
  136. elseif key:lower() == "a" then
  137. ctrl.l = -1
  138. elseif key:lower() == "d" then
  139. ctrl.r = 1
  140. end
  141. end)
  142.  
  143. mouse.KeyUp:connect(function(key)
  144. if key:lower() == "w" then
  145. ctrl.f = 0
  146. elseif key:lower() == "s" then
  147. ctrl.b = 0
  148. elseif key:lower() == "a" then
  149. ctrl.l = 0
  150. elseif key:lower() == "d" then
  151. ctrl.r = 0
  152. end
  153. end)
  154. Fly()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement