Guest User

fly on any games pres f

a guest
Nov 1st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. --Script edited and remade by BlueBearTim
  2. --Original source: Infinite Yield
  3. lplayer = game:GetService("Players").LocalPlayer
  4. local Mouse = lplayer:GetMouse()
  5. flying = false
  6. local potato = 1
  7. Mouse.KeyDown:connect(function(key)
  8. if key == "f" then
  9. if potato == 1 then
  10. repeat wait() until lplayer and lplayer.Character and lplayer.Character:FindFirstChild('HumanoidRootPart') and lplayer.Character:FindFirstChild('Humanoid')
  11. repeat wait() until Mouse
  12. speedfly = 1
  13.  
  14. local T = lplayer.Character.HumanoidRootPart
  15. local CONTROL = {F = 0, B = 0, L = 0, R = 0}
  16. local lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  17. local SPEED = speedget
  18.  
  19. local function fly()
  20. flying = true
  21. local BG = Instance.new('BodyGyro', T)
  22. local BV = Instance.new('BodyVelocity', T)
  23. BG.P = 9e4
  24. BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  25. BG.cframe = T.CFrame
  26. BV.velocity = Vector3.new(0, 0.1, 0)
  27. BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
  28. spawn(function()
  29. repeat wait()
  30. lplayer.Character.Humanoid.PlatformStand = true
  31. if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 then
  32. SPEED = 50
  33. elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0) and SPEED ~= 0 then
  34. SPEED = 0
  35. end
  36. if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 then
  37. BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (CONTROL.F + CONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(CONTROL.L + CONTROL.R, (CONTROL.F + CONTROL.B) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  38. lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
  39. elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and SPEED ~= 0 then
  40. BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lCONTROL.F + lCONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(lCONTROL.L + lCONTROL.R, (lCONTROL.F + lCONTROL.B) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  41. else
  42. BV.velocity = Vector3.new(0, 0.1, 0)
  43. end
  44. BG.cframe = workspace.CurrentCamera.CoordinateFrame
  45. until not flying
  46. CONTROL = {F = 0, B = 0, L = 0, R = 0}
  47. lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  48. SPEED = 0
  49. BG:destroy()
  50. BV:destroy()
  51. lplayer.Character.Humanoid.PlatformStand = false
  52. end)
  53. end
  54. Mouse.KeyDown:connect(function(KEY)
  55. if KEY:lower() == 'w' then
  56. CONTROL.F = speedfly
  57. elseif KEY:lower() == 's' then
  58. CONTROL.B = -speedfly
  59. elseif KEY:lower() == 'a' then
  60. CONTROL.L = -speedfly
  61. elseif KEY:lower() == 'd' then
  62. CONTROL.R = speedfly
  63. end
  64. end)
  65. Mouse.KeyUp:connect(function(KEY)
  66. if KEY:lower() == 'w' then
  67. CONTROL.F = 0
  68. elseif KEY:lower() == 's' then
  69. CONTROL.B = 0
  70. elseif KEY:lower() == 'a' then
  71. CONTROL.L = 0
  72. elseif KEY:lower() == 'd' then
  73. CONTROL.R = 0
  74. end
  75. end)
  76. potato = 0
  77. fly()
  78. else
  79. flying = false
  80. lplayer.Character.Humanoid.PlatformStand = false
  81. potato = 1
  82. end end end)
Add Comment
Please, Sign In to add comment