NaagYt

Antilag and fly(test) , nao funcionou? Fale comigo!

Jan 12th, 2024
92
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. -- Criando um menu
  2. local menu = Instance.new ("ScreenGui")
  3. menu.Name = "Menu"
  4. menu.Parent = game.Players.LocalPlayer:WaitForChild ("PlayerGui")
  5.  
  6. -- Criando um botão para abrir o menu
  7. local openButton = Instance.new ("TextButton")
  8. openButton.Name = "OpenButton"
  9. openButton.Text = "Menu"
  10. openButton.Size = UDim2.new (0, 100, 0, 50)
  11. openButton.Position = UDim2.new (0, 10, 0, 10)
  12. openButton.Parent = menu
  13.  
  14. -- Criando um frame para o menu
  15. local menuFrame = Instance.new ("Frame")
  16. menuFrame.Name = "MenuFrame"
  17. menuFrame.Size = UDim2.new (0, 200, 0, 300)
  18. menuFrame.Position = UDim2.new (0, 120, 0, 10)
  19. menuFrame.Visible = false
  20. menuFrame.Parent = menu
  21.  
  22. -- Criando um texto para o menu
  23. local menuText = Instance.new ("TextLabel")
  24. menuText.Name = "MenuText"
  25. menuText.Text = "Escolha uma opção:"
  26. menuText.Size = UDim2.new (1, 0, 0, 50)
  27. menuText.Parent = menuFrame
  28.  
  29. -- Criando um botão para antilag
  30. local antilagButton = Instance.new ("TextButton")
  31. antilagButton.Name = "AntilagButton"
  32. antilagButton.Text = "Antilag"
  33. antilagButton.Size = UDim2.new (1, 0, 0, 50)
  34. antilagButton.Position = UDim2.new (0, 0, 0, 50)
  35. antilagButton.Parent = menuFrame
  36.  
  37. -- Criando um botão para fly
  38. local flyButton = Instance.new ("TextButton")
  39. flyButton.Name = "FlyButton"
  40. flyButton.Text = "Fly"
  41. flyButton.Size = UDim2.new (1, 0, 0, 50)
  42. flyButton.Position = UDim2.new (0, 0, 0, 100)
  43. flyButton.Parent = menuFrame
  44.  
  45. -- Criando um frame para o fly
  46. local flyFrame = Instance.new ("Frame")
  47. flyFrame.Name = "FlyFrame"
  48. flyFrame.Size = UDim2.new (0, 200, 0, 200)
  49. flyFrame.Position = UDim2.new (0, 330, 0, 10)
  50. flyFrame.Visible = false
  51. flyFrame.Parent = menu
  52.  
  53. -- Criando um texto para o fly
  54. local flyText = Instance.new ("TextLabel")
  55. flyText.Name = "FlyText"
  56. flyText.Text = "Créditos: Admin"
  57. flyText.Size = UDim2.new (1, 0, 0, 50)
  58. flyText.Parent = flyFrame
  59.  
  60. -- Criando um botão para ativar o fly
  61. local activateButton = Instance.new ("TextButton")
  62. activateButton.Name = "ActivateButton"
  63. activateButton.Text = "Ativar"
  64. activateButton.Size = UDim2.new (1, 0, 0, 50)
  65. activateButton.Position = UDim2.new (0, 0, 0, 50)
  66. activateButton.Parent = flyFrame
  67.  
  68. -- Criando um botão para desativar o fly
  69. local deactivateButton = Instance.new ("TextButton")
  70. deactivateButton.Name = "DeactivateButton"
  71. deactivateButton.Text = "Desativar"
  72. deactivateButton.Size = UDim2.new (1, 0, 0, 50)
  73. deactivateButton.Position = UDim2.new (0, 0, 0, 100)
  74. deactivateButton.Parent = flyFrame
  75.  
  76. -- Definindo as variáveis para o fly
  77. local player = game.Players.LocalPlayer
  78. local mouse = player:GetMouse ()
  79. local flying = false
  80. local speed = 0.5
  81. local keys = {a = false, d = false, w = false, s = false}
  82.  
  83. -- Definindo a função para o fly
  84. local function fly ()
  85. local bodyGyro = Instance.new ("BodyGyro")
  86. bodyGyro.Parent = player.Character.UpperTorso
  87. bodyGyro.MaxTorque = Vector3.new (9e9, 9e9, 9e9)
  88. bodyGyro.CFrame = player.Character.UpperTorso.CFrame
  89. local bodyVelocity = Instance.new ("BodyVelocity")
  90. bodyVelocity.Parent = player.Character.UpperTorso
  91. bodyVelocity.MaxForce = Vector3.new (9e9, 9e9, 9e9)
  92. bodyVelocity.Velocity = player.Character.UpperTorso.Velocity
  93. flying = true
  94. repeat
  95. wait ()
  96. player.Character.Humanoid.PlatformStand = true
  97. local new = (bodyGyro.CFrame - bodyGyro.CFrame.p) + mouse.Hit.p
  98. local move = (new - bodyGyro.CFrame.p).Magnitude * speed
  99. if keys.w then
  100. new = new + bodyGyro.CFrame.lookVector * move
  101. end
  102. if keys.s then
  103. new = new - bodyGyro.CFrame.lookVector * move
  104. end
  105. if keys.d then
  106. new = new * CFrame.new (move, 0, 0)
  107. end
  108. if keys.a then
  109. new = new * CFrame.new (-move, 0, 0)
  110. end
  111. if keys.space then
  112. new = new + Vector3.new (0, move, 0)
  113. end
  114. bodyGyro.CFrame = new
  115. bodyVelocity.Velocity = Vector3.new (0, 0.1, 0)
  116. until not flying
  117. bodyGyro:Destroy ()
  118. bodyVelocity:Destroy ()
  119. player.Character.Humanoid.PlatformStand = false
  120. end
  121.  
  122. -- Definindo a função para o antilag
  123. local function antilag ()
  124. local graphics = game:GetService ("UserSettings"):GetService ("UserGameSettings")
  125. graphics.SavedQualityLevel = Enum.QualityLevel.Level01
  126. graphics.GraphicsMode = Enum.GraphicsMode.Automatic
  127. graphics.MeshQuality = Enum.MeshQuality.Low
  128. graphics.TextureQuality = Enum.TextureQuality.Low
  129. graphics.ShadowQuality = Enum.ShadowQuality.Low
  130. graphics.MaterialQuality = Enum.MaterialQuality.Low
  131. graphics.Antialiasing = Enum.AntialiasingMode.Off
  132. graphics.AnisotropicFiltering = Enum.AnisotropicFilteringMode.Off
  133. end
  134.  
  135. -- Definindo os eventos para os botões
  136. openButton.MouseButton1Click:Connect (function ()
  137. menuFrame.Visible = not menuFrame.Visible
  138. end)
  139.  
  140. antilagButton.MouseButton1Click:Connect (function ()
  141. antilag ()
  142. end)
  143.  
  144. flyButton.MouseButton1Click:Connect (function ()
  145. flyFrame.Visible = not flyFrame.Visible
  146. end)
  147.  
  148. activateButton.MouseButton1Click:Connect (function ()
  149. fly ()
  150. end)
  151.  
  152. deactivateButton.MouseButton1Click:Connect (function ()
  153. flying = false
  154. end)
  155.  
  156. -- Definindo os eventos para as teclas
  157. mouse.KeyDown:Connect (function (key)
  158. if key:lower () == "w" then
  159. keys.w = true
  160. elseif key:lower () == "s" then
  161. keys.s = true
  162. elseif key:lower () == "a" then
  163. keys.a = true
  164. elseif key:lower () == "d" then
  165. keys.d = true
  166. elseif key:lower () == "space" then
  167. keys.space = true
  168. end
  169. end)
  170.  
  171. mouse.KeyUp:Connect (function (key)
  172. if key:lower () == "w" then
  173. keys.w = false
  174. elseif key:lower () == "s" then
  175. keys.s = false
  176. elseif key:lower () == "a" then
  177. keys.a = false
  178. elseif key:lower () == "d" then
  179. keys.d = false
  180. elseif key:lower () == "space" then
  181. keys.space = false
  182. end
  183. end)
  184.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment