Advertisement
Guest User

v1

a guest
Dec 11th, 2019
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1.  
  2.  
  3.  
  4. local LP = game.Players.LocalPlayer
  5. local Mouse = LP:GetMouse()
  6. toggler = false
  7.  
  8. FLYING = false
  9. iyflyspeed = 4
  10. function sFLY() -- from rocky2u cmdscript
  11.  
  12. repeat wait() until LP and LP.Character and LP.Character:FindFirstChild('HumanoidRootPart') and LP.Character:FindFirstChild('Humanoid')
  13. game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
  14. repeat wait() until Mouse
  15. local T = game.Players.LocalPlayer.Character.HumanoidRootPart
  16. local CONTROL = {F = 0, B = 0, L = 0, R = 0}
  17. local lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  18. local SPEED = 0
  19.  
  20. local function FLY()
  21. FLYING = true
  22. local BG = Instance.new('BodyGyro', T)
  23. local BV = Instance.new('BodyVelocity', T)
  24. BG.P = 9e4
  25. BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  26. BG.cframe = T.CFrame
  27. BV.velocity = Vector3.new(0, 0.1, 0)
  28. BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
  29. spawn(function()
  30. repeat wait()
  31.  
  32. if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 then
  33. SPEED = 50
  34. elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0) and SPEED ~= 0 then
  35. SPEED = 0
  36. end
  37. if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 then
  38. 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
  39. lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
  40. elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and SPEED ~= 0 then
  41. 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
  42. else
  43. BV.velocity = Vector3.new(0, 0.1, 0)
  44. end
  45. BG.cframe = workspace.CurrentCamera.CoordinateFrame
  46. until not FLYING
  47. CONTROL = {F = 0, B = 0, L = 0, R = 0}
  48. lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  49. SPEED = 0
  50. BG:destroy()
  51. BV:destroy()
  52. end)
  53. end
  54. Mouse.KeyDown:connect(function(KEY)
  55. if KEY:lower() == 'w' then
  56. CONTROL.F = iyflyspeed
  57. elseif KEY:lower() == 's' then
  58. CONTROL.B = -iyflyspeed
  59. elseif KEY:lower() == 'a' then
  60. CONTROL.L = -iyflyspeed
  61. elseif KEY:lower() == 'd' then
  62. CONTROL.R = iyflyspeed
  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. FLY()
  77. game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
  78. end
  79.  
  80.  
  81. function NOFLY()
  82. FLYING = false
  83. end
  84.  
  85. function startflying()
  86. game.Players.LocalPlayer.PlayerGui.LocalScript.Disabled = true
  87. wait()
  88. sFLY()
  89. wait(0.1)
  90. game.Players.LocalPlayer.PlayerGui.LocalScript.Disabled = false
  91. local Float = Instance.new('Part', game.Players.LocalPlayer.Character)
  92. Float.Name = 'Float'
  93. Float.Transparency = 1
  94. Float.Size = Vector3.new(6,1,6)
  95. Float.Anchored = true
  96. end
  97.  
  98. Mouse.KeyDown:Connect(function(key)
  99. if key == "x" then
  100. game.Players.LocalPlayer.Character.Animate.jump.JumpAnim.AnimationId = "http://www.roblox.com/asset/?id=1132489853"
  101. game.Players.LocalPlayer.Character.Animate.fall.FallAnim.AnimationId = "http://www.roblox.com/asset/?id=1132469004"
  102. if not toggler then
  103. toggler = true
  104. startflying()
  105. elseif toggler then
  106. toggler = false
  107. NOFLY()
  108. if game.Players.LocalPlayer.Character then
  109. if game.Players.LocalPlayer.Character:FindFirstChild("Float") then
  110. game.Players.LocalPlayer.Character:FindFirstChild("Float"):Destroy()
  111. end
  112. end
  113. end
  114.  
  115. end
  116. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement