AugusTH

Fly v1

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