Advertisement
choco99

Fly script Roblox

Dec 8th, 2021
12,125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.85 KB | None | 0 0
  1. local main = Instance.new("ScreenGui")
  2. local Frame = Instance.new("Frame")
  3. local up = Instance.new("TextButton")
  4. local down = Instance.new("TextButton")
  5. local onof = Instance.new("TextButton")
  6. local TextLabel = Instance.new("TextLabel")
  7. local plus = Instance.new("TextButton")
  8. local speed = Instance.new("TextLabel")
  9. local mine = Instance.new("TextButton")
  10.  
  11. --Properties:
  12.  
  13. main.Name = "main"
  14. main.Parent = game.CoreGui
  15. main.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  16.  
  17. Frame.Parent = main
  18. Frame.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  19. Frame.BorderColor3 = Color3.fromRGB(103, 221, 213)
  20. Frame.Position = UDim2.new(0.100320168, 0, 0.379746825, 0)
  21. Frame.Size = UDim2.new(0, 190, 0, 57)
  22.  
  23. up.Name = "up"
  24. up.Parent = Frame
  25. up.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  26. up.Size = UDim2.new(0, 44, 0, 28)
  27. up.Font = Enum.Font.SourceSans
  28. up.Text = "UP"
  29. up.TextColor3 = Color3.fromRGB(0, 0, 0)
  30. up.TextSize = 14.000
  31.  
  32. down.Name = "down"
  33. down.Parent = Frame
  34. down.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  35. down.Position = UDim2.new(0, 0, 0.491228074, 0)
  36. down.Size = UDim2.new(0, 44, 0, 28)
  37. down.Font = Enum.Font.SourceSans
  38. down.Text = "DOWN"
  39. down.TextColor3 = Color3.fromRGB(0, 0, 0)
  40. down.TextSize = 14.000
  41.  
  42. onof.Name = "onof"
  43. onof.Parent = Frame
  44. onof.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  45. onof.Position = UDim2.new(0.702823281, 0, 0.491228074, 0)
  46. onof.Size = UDim2.new(0, 56, 0, 28)
  47. onof.Font = Enum.Font.SourceSans
  48. onof.Text = "fly"
  49. onof.TextColor3 = Color3.fromRGB(0, 0, 0)
  50. onof.TextSize = 14.000
  51.  
  52. TextLabel.Parent = Frame
  53. TextLabel.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  54. TextLabel.Position = UDim2.new(0.469327301, 0, 0, 0)
  55. TextLabel.Size = UDim2.new(0, 100, 0, 28)
  56. TextLabel.Font = Enum.Font.SourceSans
  57. TextLabel.Text = "gui by me_ozoneYT"
  58. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  59. TextLabel.TextScaled = true
  60. TextLabel.TextSize = 14.000
  61. TextLabel.TextWrapped = true
  62.  
  63. plus.Name = "plus"
  64. plus.Parent = Frame
  65. plus.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  66. plus.Position = UDim2.new(0.231578946, 0, 0, 0)
  67. plus.Size = UDim2.new(0, 45, 0, 28)
  68. plus.Font = Enum.Font.SourceSans
  69. plus.Text = "+"
  70. plus.TextColor3 = Color3.fromRGB(0, 0, 0)
  71. plus.TextScaled = true
  72. plus.TextSize = 14.000
  73. plus.TextWrapped = true
  74.  
  75. speed.Name = "speed"
  76. speed.Parent = Frame
  77. speed.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  78. speed.Position = UDim2.new(0.468421042, 0, 0.491228074, 0)
  79. speed.Size = UDim2.new(0, 44, 0, 28)
  80. speed.Font = Enum.Font.SourceSans
  81. speed.Text = "1"
  82. speed.TextColor3 = Color3.fromRGB(0, 0, 0)
  83. speed.TextScaled = true
  84. speed.TextSize = 14.000
  85. speed.TextWrapped = true
  86.  
  87. mine.Name = "mine"
  88. mine.Parent = Frame
  89. mine.BackgroundColor3 = Color3.fromRGB(99, 99, 99)
  90. mine.Position = UDim2.new(0.231578946, 0, 0.491228074, 0)
  91. mine.Size = UDim2.new(0, 45, 0, 29)
  92. mine.Font = Enum.Font.SourceSans
  93. mine.Text = "-"
  94. mine.TextColor3 = Color3.fromRGB(0, 0, 0)
  95. mine.TextScaled = true
  96. mine.TextSize = 14.000
  97. mine.TextWrapped = true
  98.  
  99. speeds = 1
  100.  
  101. local speaker = game:GetService("Players").LocalPlayer
  102.  
  103. local chr = game.Players.LocalPlayer.Character
  104. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  105.  
  106. nowe = false
  107.  
  108. Frame.Active = true -- main = gui
  109. Frame.Draggable = true
  110.  
  111. onof.MouseButton1Down:connect(function()
  112.  
  113.     if nowe == true then
  114.         nowe = false
  115.  
  116.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing,true)
  117.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown,true)
  118.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying,true)
  119.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall,true)
  120.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,true)
  121.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,true)
  122.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed,true)
  123.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
  124.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,true)
  125.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
  126.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,true)
  127.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,true)
  128.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,true)
  129.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics,true)
  130.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming,true)
  131.         speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
  132.     else
  133.         nowe = true
  134.  
  135.  
  136.  
  137.         for i = 1, speeds do
  138.             spawn(function()
  139.  
  140.                 local hb = game:GetService("RunService").Heartbeat 
  141.  
  142.  
  143.                 tpwalking = true
  144.                 local chr = game.Players.LocalPlayer.Character
  145.                 local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  146.                 while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  147.                     if hum.MoveDirection.Magnitude > 0 then
  148.                         chr:TranslateBy(hum.MoveDirection)
  149.                     end
  150.                 end
  151.  
  152.             end)
  153.         end
  154.         game.Players.LocalPlayer.Character.Animate.Disabled = true
  155.         local Char = game.Players.LocalPlayer.Character
  156.         local Hum = Char:FindFirstChildOfClass("Humanoid") or Char:FindFirstChildOfClass("AnimationController")
  157.  
  158.         for i,v in next, Hum:GetPlayingAnimationTracks() do
  159.             v:AdjustSpeed(0)
  160.         end
  161.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing,false)
  162.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
  163.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying,false)
  164.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall,false)
  165.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
  166.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,false)
  167.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed,false)
  168.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,false)
  169.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,false)
  170.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  171.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
  172.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,false)
  173.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,false)
  174.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics,false)
  175.         speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming,false)
  176.         speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Swimming)
  177.     end
  178.  
  179.  
  180.  
  181.  
  182.  
  183.         local plr = game.Players.LocalPlayer
  184.         local UpperTorso = plr.Character.LowerTorso
  185.         local flying = true
  186.         local deb = true
  187.         local ctrl = {f = 0, b = 0, l = 0, r = 0}
  188.         local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  189.         local maxspeed = 50
  190.         local speed = 0
  191.  
  192.  
  193.         local bg = Instance.new("BodyGyro", UpperTorso)
  194.         bg.P = 9e4
  195.         bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  196.         bg.cframe = UpperTorso.CFrame
  197.         local bv = Instance.new("BodyVelocity", UpperTorso)
  198.         bv.velocity = Vector3.new(0,0.1,0)
  199.         bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  200.         if nowe == true then
  201.             plr.Character.Humanoid.PlatformStand = true
  202.         end
  203.         while nowe == true or game:GetService("Players").LocalPlayer.Character.Humanoid.Health == 0 do
  204.             wait()
  205.  
  206.             if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  207.                 speed = speed+.5+(speed/maxspeed)
  208.                 if speed > maxspeed then
  209.                     speed = maxspeed
  210.                 end
  211.             elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  212.                 speed = speed-1
  213.                 if speed < 0 then
  214.                     speed = 0
  215.                 end
  216.             end
  217.             if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  218.                 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
  219.                 lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  220.             elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  221.                 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
  222.             else
  223.                 bv.velocity = Vector3.new(0,0,0)
  224.             end
  225.  
  226.             bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  227.         end
  228.         ctrl = {f = 0, b = 0, l = 0, r = 0}
  229.         lastctrl = {f = 0, b = 0, l = 0, r = 0}
  230.         speed = 0
  231.         bg:Destroy()
  232.         bv:Destroy()
  233.         plr.Character.Humanoid.PlatformStand = false
  234.         game.Players.LocalPlayer.Character.Animate.Disabled = false
  235.         tpwalking = false
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. end)
  246.  
  247.  
  248. up.MouseButton1Down:connect(function()
  249.     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,2,0)
  250.  
  251. end)
  252.  
  253.  
  254. down.MouseButton1Down:connect(function()
  255.  
  256.     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,-2,0)
  257.  
  258. end)
  259.  
  260.  
  261. game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(char)
  262.     wait(0.7)
  263.     game.Players.LocalPlayer.Character.Humanoid.PlatformStand = false
  264.     game.Players.LocalPlayer.Character.Animate.Disabled = false
  265.  
  266. end)
  267.  
  268.  
  269. plus.MouseButton1Down:connect(function()
  270.     speeds = speeds + 1
  271.     speed.Text = speeds
  272.     if nowe == true then
  273.  
  274.  
  275.     tpwalking = false
  276.     for i = 1, speeds do
  277.         spawn(function()
  278.  
  279.             local hb = game:GetService("RunService").Heartbeat 
  280.  
  281.  
  282.             tpwalking = true
  283.             local chr = game.Players.LocalPlayer.Character
  284.             local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  285.             while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  286.                 if hum.MoveDirection.Magnitude > 0 then
  287.                     chr:TranslateBy(hum.MoveDirection)
  288.                 end
  289.             end
  290.  
  291.         end)
  292.         end
  293.         end
  294. end)
  295. mine.MouseButton1Down:connect(function()
  296.     if speeds == 1 then
  297.         speed.Text = 'can not be less than 1'
  298.         wait(1)
  299.         speed.Text = speeds
  300.     else
  301.     speeds = speeds - 1
  302.         speed.Text = speeds
  303.         if nowe == true then
  304.     tpwalking = false
  305.     for i = 1, speeds do
  306.         spawn(function()
  307.  
  308.             local hb = game:GetService("RunService").Heartbeat 
  309.  
  310.  
  311.             tpwalking = true
  312.             local chr = game.Players.LocalPlayer.Character
  313.             local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  314.             while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  315.                 if hum.MoveDirection.Magnitude > 0 then
  316.                     chr:TranslateBy(hum.MoveDirection)
  317.                 end
  318.             end
  319.  
  320.         end)
  321.         end
  322.         end
  323.         end
  324. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement