MaxproGlitcher

Fly scritp by MaxproGlitcher

Jul 30th, 2022 (edited)
5,613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. local s,f=pcall(function()
  2. -- press F for fly
  3.  
  4. repeat wait()
  5. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Head") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  6. local mouse = game.Players.LocalPlayer:GetMouse()
  7. repeat wait() until mouse
  8. local plr = game.Players.LocalPlayer
  9. local torso = plr.Character.Head
  10. local flying = false
  11. local deb = true
  12. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  13. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  14. local maxspeed = 1000
  15. local speed = 50
  16.  
  17. function Fly()
  18. local bg = Instance.new("BodyGyro", torso)
  19. bg.P = 9e4
  20. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  21. bg.cframe = torso.CFrame
  22. local bv = Instance.new("BodyVelocity", torso)
  23. bv.velocity = Vector3.new(0,0.1,0)
  24. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  25. repeat wait()
  26. torso.Parent.Humanoid.PlatformStand = true
  27. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  28. speed = speed+.10+(speed/maxspeed)
  29. if speed > maxspeed then
  30. speed = maxspeed
  31. end
  32. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  33. speed = speed-1
  34. if speed < 0 then
  35. speed = 0
  36. else
  37. speed = 50
  38. end
  39. end
  40. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  41. 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
  42. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  43. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  44. 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
  45. else
  46. bv.velocity = Vector3.new(0,0.1,0)
  47. end
  48. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  49. until not flying
  50. ctrl = {f = 0, b = 0, l = 0, r = 0} -----------------------
  51. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  52. bg:Destroy()
  53. bv:Destroy()
  54. plr.Character.Humanoid.PlatformStand = false
  55. speed = 50
  56. end
  57.  
  58. mouse.KeyDown:connect(function(key)
  59. if key:lower() == "f" then
  60. if flying then flying = false
  61. else
  62. flying = true
  63. Fly()
  64. end
  65. elseif key:lower() == "w" then
  66. ctrl.f = 1
  67. elseif key:lower() == "s" then
  68. ctrl.b = -1
  69. elseif key:lower() == "a" then
  70. ctrl.l = -1
  71. elseif key:lower() == "d" then
  72. ctrl.r = 1
  73. end
  74. end)
  75. mouse.KeyUp:connect(function(key)
  76. if key:lower() == "w" then
  77. ctrl.f = 0
  78. lastctrl.f=0
  79. elseif key:lower() == "s" then
  80. ctrl.b = 0
  81. lastctrl.b=0
  82. elseif key:lower() == "a" then
  83. ctrl.l = 0
  84. lastctrl.l=0
  85. elseif key:lower() == "d" then
  86. ctrl.r = 0
  87. lastctrl.r=0
  88. end
  89. end)
  90. Fly ()
  91. end) if not s then print(f)end
Advertisement
Add Comment
Please, Sign In to add comment