Advertisement
KirchohexSX

Flyscript--By Kirchohex

Dec 18th, 2020 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. -- Made by Kirchohex tt:coolkircho
  2. local ScreenGui = Instance.new("ScreenGui")
  3. local main = Instance.new("Frame")
  4. local title = Instance.new("TextLabel")
  5. local FlyTest = Instance.new("TextButton")
  6. local Close = Instance.new("TextButton")
  7. local openmain = Instance.new("Frame")
  8. local open = Instance.new("TextButton")
  9.  
  10. --Properties:
  11.  
  12. ScreenGui.Parent = game.CoreGui
  13.  
  14. main.Name = "main"
  15. main.Parent = ScreenGui
  16. main.BackgroundColor3 = Color3.fromRGB(89, 89, 89)
  17. main.Position = UDim2.new(0.702230632, 0, -0.00167222321, 0)
  18. main.Size = UDim2.new(0, 368, 0, 212)
  19. main.Visible = false
  20.  
  21. main.Active = True
  22. main.Draggable =true
  23. title.Name = "title"
  24. title.Parent = main
  25. title.BackgroundColor3 = Color3.fromRGB(107, 106, 106)
  26. title.BorderColor3 = Color3.fromRGB(80, 79, 255)
  27. title.Size = UDim2.new(0, 368, 0, 31)
  28. title.Font = Enum.Font.SciFi
  29. title.Text = "Kirchohex's hub"
  30. title.TextColor3 = Color3.fromRGB(0, 0, 0)
  31. title.TextSize = 14.000
  32.  
  33. FlyTest.Name = "FlyTest"
  34. FlyTest.Parent = main
  35. FlyTest.BackgroundColor3 = Color3.fromRGB(106, 69, 255)
  36. FlyTest.Position = UDim2.new(0, 0, 0.22169812, 0)
  37. FlyTest.Size = UDim2.new(0, 110, 0, 50)
  38. FlyTest.Font = Enum.Font.Ubuntu
  39. FlyTest.Text = "FlyTest"
  40. FlyTest.TextColor3 = Color3.fromRGB(0, 0, 0)
  41. FlyTest.TextSize = 14.000
  42. FlyTest.MouseButton1Down:connect(function()
  43. repeat wait()
  44. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("HumanoidRootPart") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  45. local mouse = game.Players.LocalPlayer:GetMouse()
  46. repeat wait() until mouse
  47. local plr = game.Players.LocalPlayer
  48. local torso = plr.Character.HumanoidRootPart
  49. local flying = true
  50. local deb = true
  51. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  52. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  53. local maxspeed = 50
  54. local speed = 0
  55.  
  56. function Fly()
  57. local bg = Instance.new("BodyGyro", torso)
  58. bg.P = 9e4
  59. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  60. bg.cframe = torso.CFrame
  61. local bv = Instance.new("BodyVelocity", torso)
  62. bv.velocity = Vector3.new(0,0.1,0)
  63. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  64. repeat wait()
  65. plr.Character.Humanoid.PlatformStand = true
  66. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  67. speed = speed+.5+(speed/maxspeed)
  68. if speed > maxspeed then
  69. speed = maxspeed
  70. end
  71. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  72. speed = speed-1
  73. if speed < 0 then
  74. speed = 0
  75. end
  76. end
  77. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  78. 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
  79. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  80. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  81. 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
  82. else
  83. bv.velocity = Vector3.new(0,0.1,0)
  84. end
  85. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  86. until not flying
  87. ctrl = {f = 0, b = 0, l = 0, r = 0}
  88. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  89. speed = 0
  90. bg:Destroy()
  91. bv:Destroy()
  92. plr.Character.Humanoid.PlatformStand = false
  93. end
  94. mouse.KeyDown:connect(function(key)
  95. if key:lower() == "e" then
  96. if flying then flying = false
  97. else
  98. flying = true
  99. Fly()
  100. end
  101. elseif key:lower() == "w" then
  102. ctrl.f = 1
  103. elseif key:lower() == "s" then
  104. ctrl.b = -1
  105. elseif key:lower() == "a" then
  106. ctrl.l = -1
  107. elseif key:lower() == "d" then
  108. ctrl.r = 1
  109. end
  110. end)
  111. mouse.KeyUp:connect(function(key)
  112. if key:lower() == "w" then
  113. ctrl.f = 0
  114. elseif key:lower() == "s" then
  115. ctrl.b = 0
  116. elseif key:lower() == "a" then
  117. ctrl.l = 0
  118. elseif key:lower() == "d" then
  119. ctrl.r = 0
  120. end
  121. end)
  122. Fly()
  123. end)
  124.  
  125. Close.Name = "Close"
  126. Close.Parent = main
  127. Close.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  128. Close.Position = UDim2.new(0.861413002, 0, 0.839622557, 0)
  129. Close.Size = UDim2.new(0, 51, 0, 34)
  130. Close.Font = Enum.Font.Gotham
  131. Close.Text = "Close"
  132. Close.TextColor3 = Color3.fromRGB(0, 0, 0)
  133. Close.TextSize = 14.000
  134. Close.MouseButton1Down:connect(function()
  135. main.Visible = false
  136. openmain.Visible = true
  137. end)
  138. openmain.Name = "openmain"
  139. openmain.Parent = ScreenGui
  140. openmain.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  141. openmain.Position = UDim2.new(0.927250683, 0, 0.367892921, 0)
  142. openmain.Size = UDim2.new(0, 78, 0, 42)
  143. openmain.Active = true
  144. openmain.Draggable = true
  145. open.Name = "open"
  146. open.Parent = openmain
  147. open.BackgroundColor3 = Color3.fromRGB(0, 162, 0)
  148. open.Position = UDim2.new(-3.12924385e-07, 0, 1.1920929e-07, 0)
  149. open.Size = UDim2.new(0, 78, 0, 42)
  150. open.Font = Enum.Font.RobotoMono
  151. open.Text = "Open"
  152. open.TextColor3 = Color3.fromRGB(0, 0, 0)
  153. open.TextSize = 14.000
  154. open.MouseButton1Down:connect(function()
  155. openmain.Visible = false
  156. main.Visible = true
  157. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement