Advertisement
Guest User

Fly Gui

a guest
May 16th, 2021
8,622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. -- Made by Iantzensean1234
  2. -- Subscribe to Iantzensean1234
  3.  
  4. local ScreenGui = Instance.new("ScreenGui")
  5. local Main = Instance.new("Frame")
  6. local TextLabel = Instance.new("TextLabel")
  7. local TextButton = Instance.new("TextButton")
  8.  
  9. --Properties:
  10.  
  11. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12.  
  13. Main.Name = "Main"
  14. Main.Parent = ScreenGui
  15. Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  16. Main.Position = UDim2.new(0.363293529, 0, 0.28638497, 0)
  17. Main.Size = UDim2.new(0, 340, 0, 190)
  18. Main.Style = Enum.FrameStyle.ChatBlue
  19.  
  20. TextLabel.Parent = Main
  21. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  22. TextLabel.BackgroundTransparency = 1.000
  23. TextLabel.Position = UDim2.new(-0.025588274, 0, -0.0890700519, 0)
  24. TextLabel.Size = UDim2.new(0, 325, 0, 50)
  25. TextLabel.Font = Enum.Font.SciFi
  26. TextLabel.Text = "Fly Gui"
  27. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  28. TextLabel.TextScaled = true
  29. TextLabel.TextSize = 14.000
  30. TextLabel.TextWrapped = true
  31.  
  32. TextButton.Parent = Main
  33. TextButton.BackgroundColor3 = Color3.fromRGB(255, 31, 255)
  34. TextButton.Position = UDim2.new(0.136470661, 0, 0.458670378, 0)
  35. TextButton.Size = UDim2.new(0, 224, 0, 58)
  36. TextButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
  37. TextButton.Font = Enum.Font.SciFi
  38. TextButton.Text = "Fly"
  39. TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  40. TextButton.TextScaled = true
  41. TextButton.TextSize = 14.000
  42. TextButton.TextWrapped = true
  43. TextButton.MouseButton1Down:connect(function()
  44. repeat wait()
  45. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  46. local mouse = game.Players.LocalPlayer:GetMouse()
  47. repeat wait() until mouse
  48. local plr = game.Players.LocalPlayer
  49. local torso = plr.Character.Torso
  50. local flying = true
  51. local deb = true
  52. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  53. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  54. local maxspeed = 50
  55. local speed = 0
  56.  
  57. function Fly()
  58. local bg = Instance.new("BodyGyro", torso)
  59. bg.P = 9e4
  60. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  61. bg.cframe = torso.CFrame
  62. local bv = Instance.new("BodyVelocity", torso)
  63. bv.velocity = Vector3.new(0,0.1,0)
  64. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  65. repeat wait()
  66. plr.Character.Humanoid.PlatformStand = true
  67. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  68. speed = speed+.5+(speed/maxspeed)
  69. if speed > maxspeed then
  70. speed = maxspeed
  71. end
  72. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  73. speed = speed-1
  74. if speed < 0 then
  75. speed = 0
  76. end
  77. end
  78. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  79. 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
  80. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  81. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  82. 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
  83. else
  84. bv.velocity = Vector3.new(0,0.1,0)
  85. end
  86. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  87. until not flying
  88. ctrl = {f = 0, b = 0, l = 0, r = 0}
  89. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  90. speed = 0
  91. bg:Destroy()
  92. bv:Destroy()
  93. plr.Character.Humanoid.PlatformStand = false
  94. end
  95. mouse.KeyDown:connect(function(key)
  96. if key:lower() == "e" then
  97. if flying then flying = false
  98. else
  99. flying = true
  100. Fly()
  101. end
  102. elseif key:lower() == "w" then
  103. ctrl.f = 1
  104. elseif key:lower() == "s" then
  105. ctrl.b = -1
  106. elseif key:lower() == "a" then
  107. ctrl.l = -1
  108. elseif key:lower() == "d" then
  109. ctrl.r = 1
  110. end
  111. end)
  112. mouse.KeyUp:connect(function(key)
  113. if key:lower() == "w" then
  114. ctrl.f = 0
  115. elseif key:lower() == "s" then
  116. ctrl.b = 0
  117. elseif key:lower() == "a" then
  118. ctrl.l = 0
  119. elseif key:lower() == "d" then
  120. ctrl.r = 0
  121. end
  122. end)
  123. Fly()
  124. end)
  125. -- Scripts:
  126.  
  127. local function LASGYB_fake_script() -- ScreenGui.Script
  128. local script = Instance.new('Script', ScreenGui)
  129.  
  130. frame = script.Parent.Main -- Take out {}s, and put name of frame
  131. frame.Draggable = true
  132. frame.Active = true
  133. frame.Selectable = true
  134. end
  135. coroutine.wrap(LASGYB_fake_script)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement