Advertisement
x_zstd

Fly with left trigger toggle

Jul 8th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.60 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. local closebutton = Instance.new("TextButton")
  11. local mini = Instance.new("TextButton")
  12. local mini2 = Instance.new("TextButton")
  13.  
  14. main.Name = "main"
  15. main.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  16. main.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  17. main.ResetOnSpawn = false
  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.SourceSans
  59. TextLabel.Text = "FLY GUI V3"
  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. closebutton.Name = "Close"
  102. closebutton.Parent = main.Frame
  103. closebutton.BackgroundColor3 = Color3.fromRGB(225, 25, 0)
  104. closebutton.Font = "SourceSans"
  105. closebutton.Size = UDim2.new(0, 45, 0, 28)
  106. closebutton.Text = "X"
  107. closebutton.TextSize = 30
  108. closebutton.Position = UDim2.new(0, 0, -1, 27)
  109.  
  110. mini.Name = "minimize"
  111. mini.Parent = main.Frame
  112. mini.BackgroundColor3 = Color3.fromRGB(192, 150, 230)
  113. mini.Font = "SourceSans"
  114. mini.Size = UDim2.new(0, 45, 0, 28)
  115. mini.Text = "-"
  116. mini.TextSize = 40
  117. mini.Position = UDim2.new(0, 44, -1, 27)
  118.  
  119. mini2.Name = "minimize2"
  120. mini2.Parent = main.Frame
  121. mini2.BackgroundColor3 = Color3.fromRGB(192, 150, 230)
  122. mini2.Font = "SourceSans"
  123. mini2.Size = UDim2.new(0, 45, 0, 28)
  124. mini2.Text = "+"
  125. mini2.TextSize = 40
  126. mini2.Position = UDim2.new(0, 44, -1, 57)
  127. mini2.Visible = false
  128.  
  129. speeds = 1
  130.  
  131. local speaker = game:GetService("Players").LocalPlayer
  132.  
  133. local chr = game.Players.LocalPlayer.Character
  134. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  135.  
  136. nowe = false
  137.  
  138. game:GetService("StarterGui"):SetCore("SendNotification", {
  139. Title = "fly gui v3 with xbox";
  140. Text = "by xneo";
  141. Icon = "rbxthumb://type=Asset&id=5107182114&w=150&h=150"})
  142. Duration = 5;
  143.  
  144. Frame.Active = true -- main = gui
  145. Frame.Draggable = true
  146. local u = game:GetService("UserInputService")
  147.  
  148. u.InputBegan:Connect(function(input)
  149. if input.KeyCode == Enum.KeyCode.ButtonL2 then
  150. if nowe == true then
  151. nowe = false
  152.  
  153. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing,true)
  154. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown,true)
  155. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying,true)
  156. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall,true)
  157. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,true)
  158. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,true)
  159. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed,true)
  160. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
  161. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,true)
  162. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
  163. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,true)
  164. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,true)
  165. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,true)
  166. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics,true)
  167. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming,true)
  168. speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
  169. else
  170. nowe = true
  171.  
  172.  
  173.  
  174. for i = 1, speeds do
  175. spawn(function()
  176.  
  177. local hb = game:GetService("RunService").Heartbeat
  178.  
  179.  
  180. tpwalking = true
  181. local chr = game.Players.LocalPlayer.Character
  182. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  183. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  184. if hum.MoveDirection.Magnitude > 0 then
  185. chr:TranslateBy(hum.MoveDirection)
  186. end
  187. end
  188.  
  189. end)
  190. end
  191. game.Players.LocalPlayer.Character.Animate.Disabled = true
  192. local Char = game.Players.LocalPlayer.Character
  193. local Hum = Char:FindFirstChildOfClass("Humanoid") or Char:FindFirstChildOfClass("AnimationController")
  194.  
  195. for i,v in next, Hum:GetPlayingAnimationTracks() do
  196. v:AdjustSpeed(0)
  197. end
  198. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing,false)
  199. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
  200. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Flying,false)
  201. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall,false)
  202. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
  203. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,false)
  204. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Landed,false)
  205. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,false)
  206. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,false)
  207. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  208. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
  209. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,false)
  210. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated,false)
  211. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics,false)
  212. speaker.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming,false)
  213. speaker.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Swimming)
  214. end
  215.  
  216.  
  217.  
  218.  
  219. if game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
  220.  
  221.  
  222.  
  223. local plr = game.Players.LocalPlayer
  224. local torso = plr.Character.Torso
  225. local flying = true
  226. local deb = true
  227. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  228. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  229. local maxspeed = 50
  230. local speed = 0
  231.  
  232.  
  233. local bg = Instance.new("BodyGyro", torso)
  234. bg.P = 9e4
  235. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  236. bg.cframe = torso.CFrame
  237. local bv = Instance.new("BodyVelocity", torso)
  238. bv.velocity = Vector3.new(0,0.1,0)
  239. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  240. if nowe == true then
  241. plr.Character.Humanoid.PlatformStand = true
  242. end
  243. while nowe == true or game:GetService("Players").LocalPlayer.Character.Humanoid.Health == 0 do
  244. game:GetService("RunService").RenderStepped:Wait()
  245.  
  246. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  247. speed = speed+.5+(speed/maxspeed)
  248. if speed > maxspeed then
  249. speed = maxspeed
  250. end
  251. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  252. speed = speed-1
  253. if speed < 0 then
  254. speed = 0
  255. end
  256. end
  257. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  258. 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
  259. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  260. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  261. 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
  262. else
  263. bv.velocity = Vector3.new(0,0,0)
  264. end
  265. -- game.Players.LocalPlayer.Character.Animate.Disabled = true
  266. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  267. end
  268. ctrl = {f = 0, b = 0, l = 0, r = 0}
  269. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  270. speed = 0
  271. bg:Destroy()
  272. bv:Destroy()
  273. plr.Character.Humanoid.PlatformStand = false
  274. game.Players.LocalPlayer.Character.Animate.Disabled = false
  275. tpwalking = false
  276.  
  277.  
  278.  
  279.  
  280. else
  281. local plr = game.Players.LocalPlayer
  282. local UpperTorso = plr.Character.UpperTorso
  283. local flying = true
  284. local deb = true
  285. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  286. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  287. local maxspeed = 50
  288. local speed = 0
  289.  
  290.  
  291. local bg = Instance.new("BodyGyro", UpperTorso)
  292. bg.P = 9e4
  293. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  294. bg.cframe = UpperTorso.CFrame
  295. local bv = Instance.new("BodyVelocity", UpperTorso)
  296. bv.velocity = Vector3.new(0,0.1,0)
  297. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  298. if nowe == true then
  299. plr.Character.Humanoid.PlatformStand = true
  300. end
  301. while nowe == true or game:GetService("Players").LocalPlayer.Character.Humanoid.Health == 0 do
  302. wait()
  303.  
  304. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  305. speed = speed+.5+(speed/maxspeed)
  306. if speed > maxspeed then
  307. speed = maxspeed
  308. end
  309. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  310. speed = speed-1
  311. if speed < 0 then
  312. speed = 0
  313. end
  314. end
  315. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  316. 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
  317. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  318. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  319. 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
  320. else
  321. bv.velocity = Vector3.new(0,0,0)
  322. end
  323.  
  324. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  325. end
  326. ctrl = {f = 0, b = 0, l = 0, r = 0}
  327. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  328. speed = 0
  329. bg:Destroy()
  330. bv:Destroy()
  331. plr.Character.Humanoid.PlatformStand = false
  332. game.Players.LocalPlayer.Character.Animate.Disabled = false
  333. tpwalking = false
  334.  
  335.  
  336.  
  337. end
  338.  
  339.  
  340.  
  341.  
  342. end
  343. end)
  344.  
  345. local tis
  346.  
  347. up.MouseButton1Down:connect(function()
  348. tis = up.MouseEnter:connect(function()
  349. while tis do
  350. wait()
  351. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,1,0)
  352. end
  353. end)
  354. end)
  355.  
  356. up.MouseLeave:connect(function()
  357. if tis then
  358. tis:Disconnect()
  359. tis = nil
  360. end
  361. end)
  362.  
  363. local dis
  364.  
  365. down.MouseButton1Down:connect(function()
  366. dis = down.MouseEnter:connect(function()
  367. while dis do
  368. wait()
  369. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,-1,0)
  370. end
  371. end)
  372. end)
  373.  
  374. down.MouseLeave:connect(function()
  375. if dis then
  376. dis:Disconnect()
  377. dis = nil
  378. end
  379. end)
  380.  
  381.  
  382. game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(char)
  383. wait(0.7)
  384. game.Players.LocalPlayer.Character.Humanoid.PlatformStand = false
  385. game.Players.LocalPlayer.Character.Animate.Disabled = false
  386.  
  387. end)
  388.  
  389.  
  390. plus.MouseButton1Down:connect(function()
  391. speeds = speeds + 1
  392. speed.Text = speeds
  393. if nowe == true then
  394.  
  395.  
  396. tpwalking = false
  397. for i = 1, speeds do
  398. spawn(function()
  399.  
  400. local hb = game:GetService("RunService").Heartbeat
  401.  
  402.  
  403. tpwalking = true
  404. local chr = game.Players.LocalPlayer.Character
  405. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  406. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  407. if hum.MoveDirection.Magnitude > 0 then
  408. chr:TranslateBy(hum.MoveDirection)
  409. end
  410. end
  411.  
  412. end)
  413. end
  414. end
  415. end)
  416. mine.MouseButton1Down:connect(function()
  417. if speeds == 1 then
  418. speed.Text = 'cannot be less than 1'
  419. wait(1)
  420. speed.Text = speeds
  421. else
  422. speeds = speeds - 1
  423. speed.Text = speeds
  424. if nowe == true then
  425. tpwalking = false
  426. for i = 1, speeds do
  427. spawn(function()
  428.  
  429. local hb = game:GetService("RunService").Heartbeat
  430.  
  431.  
  432. tpwalking = true
  433. local chr = game.Players.LocalPlayer.Character
  434. local hum = chr and chr:FindFirstChildWhichIsA("Humanoid")
  435. while tpwalking and hb:Wait() and chr and hum and hum.Parent do
  436. if hum.MoveDirection.Magnitude > 0 then
  437. chr:TranslateBy(hum.MoveDirection)
  438. end
  439. end
  440.  
  441. end)
  442. end
  443. end
  444. end
  445. end)
  446.  
  447. closebutton.MouseButton1Click:Connect(function()
  448. main:Destroy()
  449. end)
  450.  
  451. mini.MouseButton1Click:Connect(function()
  452. up.Visible = false
  453. down.Visible = false
  454. onof.Visible = false
  455. plus.Visible = false
  456. speed.Visible = false
  457. mine.Visible = false
  458. mini.Visible = false
  459. mini2.Visible = true
  460. main.Frame.BackgroundTransparency = 1
  461. closebutton.Position = UDim2.new(0, 0, -1, 57)
  462. end)
  463.  
  464. mini2.MouseButton1Click:Connect(function()
  465. up.Visible = true
  466. down.Visible = true
  467. onof.Visible = true
  468. plus.Visible = true
  469. speed.Visible = true
  470. mine.Visible = true
  471. mini.Visible = true
  472. mini2.Visible = false
  473. main.Frame.BackgroundTransparency = 0
  474. closebutton.Position = UDim2.new(0, 0, -1, 27)
  475. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement