Advertisement
p1rt

Fly gui

Dec 27th, 2022 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/Robojini/Tuturial_UI_Library/main/UI_Template_1"))()
  2.  
  3. local Window = Library.CreateLib("made by p1rt", "RJTheme7")
  4.  
  5. local Tab = Window:NewTab("Fly")
  6.  
  7. local Section = Tab:NewSection("made by p1rt")
  8.  
  9. Section:NewLabel("Fly E")
  10. repeat wait()
  11. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  12. local mouse = game.Players.LocalPlayer:GetMouse()
  13. repeat wait() until mouse
  14. local plr = game.Players.LocalPlayer
  15. local torso = plr.Character.Torso
  16. local flying = true
  17. local deb = true
  18. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  19. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  20. local maxspeed = 5000
  21. local speed = 0
  22.  
  23. function Fly()
  24. local bg = Instance.new("BodyGyro", torso)
  25. bg.P = 9e4
  26. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  27. bg.cframe = torso.CFrame
  28. local bv = Instance.new("BodyVelocity", torso)
  29. bv.velocity = Vector3.new(0,0.1,0)
  30. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  31. repeat wait()
  32. plr.Character.Humanoid.PlatformStand = true
  33. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  34. speed = speed+.5+(speed/maxspeed)
  35. if speed > maxspeed then
  36. speed = maxspeed
  37. end
  38. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  39. speed = speed-1
  40. if speed < 0 then
  41. speed = 0
  42. end
  43. end
  44. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  45. 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
  46. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  47. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  48. 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
  49. else
  50. bv.velocity = Vector3.new(0,0.1,0)
  51. end
  52. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  53. until not flying
  54. ctrl = {f = 0, b = 0, l = 0, r = 0}
  55. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  56. speed = 0
  57. bg:Destroy()
  58. bv:Destroy()
  59. plr.Character.Humanoid.PlatformStand = false
  60. end
  61. mouse.KeyDown:connect(function(key)
  62. if key:lower() == "e" then
  63. if flying then flying = false
  64. else
  65. flying = true
  66. Fly()
  67. end
  68. elseif key:lower() == "w" then
  69. ctrl.f = 1
  70. elseif key:lower() == "s" then
  71. ctrl.b = -1
  72. elseif key:lower() == "a" then
  73. ctrl.l = -1
  74. elseif key:lower() == "d" then
  75. ctrl.r = 1
  76. end
  77. end)
  78. mouse.KeyUp:connect(function(key)
  79. if key:lower() == "w" then
  80. ctrl.f = 0
  81. elseif key:lower() == "s" then
  82. ctrl.b = 0
  83. elseif key:lower() == "a" then
  84. ctrl.l = 0
  85. elseif key:lower() == "d" then
  86. ctrl.r = 0
  87. end
  88. end)
  89. Fly()
  90.  
  91. Section:NewLabel("Discord Link")
  92. Section:NewButton("https://discord.gg/sBae3DayuK", "Printed link in F9", function()
  93. print("https://discord.gg/sBae3DayuK")
  94. end)
Tags: Gui fly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement