Advertisement
Guest User

v2

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