MaxproGlitcher

Aimbot Test

Oct 24th, 2024
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. --Fully copyright, dont reupload.
  2. local Players = game:GetService("Players")
  3. local UserInputService = game:GetService("UserInputService")
  4. local RunService = game:GetService("RunService")
  5. local TweenService = game:GetService("TweenService")
  6.  
  7. local player = Players.LocalPlayer
  8. local mouse = player:GetMouse()
  9. local lockedPlayer = nil
  10. local isLocked = false
  11. local lockDistance = 120 -- Distance threshold to lock onto a player
  12. local camera = workspace.CurrentCamera
  13.  
  14. -- Function to create the GUI
  15. local function createGui()
  16. -- Check if GUI already exists
  17. if player.PlayerGui:FindFirstChild("LockOnStatusGui") then
  18. return player.PlayerGui.LockOnStatusGui, player.PlayerGui.LockOnStatusGui.StatusFrame.StatusText
  19. end
  20.  
  21. -- Enhanced GUI Setup
  22. local ScreenGui = Instance.new("ScreenGui", player.PlayerGui)
  23. ScreenGui.Name = "LockOnStatusGui"
  24.  
  25. local StatusFrame = Instance.new("Frame", ScreenGui)
  26. StatusFrame.Name = "StatusFrame"
  27. StatusFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  28. StatusFrame.Position = UDim2.new(0.5, 0, 0.1, 0) -- Positioned at the top
  29. StatusFrame.Size = UDim2.new(0, 400, 0, 70)
  30. StatusFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  31. StatusFrame.BackgroundTransparency = 0.2
  32. StatusFrame.BorderSizePixel = 0
  33. StatusFrame.Visible = true
  34.  
  35. -- Add UI Corner for rounded corners
  36. local UICorner = Instance.new("UICorner", StatusFrame)
  37. UICorner.CornerRadius = UDim.new(0, 15)
  38.  
  39. -- Add a UI Gradient for a more epic look
  40. local UIGradient = Instance.new("UIGradient", StatusFrame)
  41. UIGradient.Color = ColorSequence.new{
  42. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
  43. ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 255))
  44. }
  45. UIGradient.Rotation = 45 -- Set rotation for a diagonal gradient effect
  46.  
  47. -- Add a shadow effect for depth
  48. local Shadow = Instance.new("Frame", StatusFrame)
  49. Shadow.Size = UDim2.new(1, 10, 1, 10)
  50. Shadow.Position = UDim2.new(0, -5, 0, -5)
  51. Shadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  52. Shadow.BackgroundTransparency = 0.7
  53. Shadow.ZIndex = -1
  54. local ShadowCorner = Instance.new("UICorner", Shadow)
  55. ShadowCorner.CornerRadius = UDim.new(0, 15)
  56.  
  57. -- Status text setup
  58. local StatusText = Instance.new("TextLabel", StatusFrame)
  59. StatusText.Name = "StatusText"
  60. StatusText.Size = UDim2.new(1, 0, 1, 0)
  61. StatusText.Font = Enum.Font.GothamBlack
  62. StatusText.TextSize = 30
  63. StatusText.TextColor3 = Color3.fromRGB(255, 255, 255)
  64. StatusText.BackgroundTransparency = 1
  65. StatusText.Text = "Finding player..."
  66.  
  67. -- Add a text stroke for a glowing effect
  68. StatusText.TextStrokeTransparency = 0.2
  69. StatusText.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  70.  
  71. -- Add mobile "Locking/Unlocking" button with epic design
  72. local LockButton = Instance.new("TextButton", ScreenGui)
  73. LockButton.Name = "LockButton"
  74. LockButton.Size = UDim2.new(0, 200, 0, 50)
  75. LockButton.Position = UDim2.new(0.5, 0, 0.9, -4) -- Positioned at the bottom-center
  76. LockButton.AnchorPoint = Vector2.new(0.5, 0.5)
  77. LockButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  78. LockButton.Text = "Locking/Unlocking"
  79. LockButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  80. LockButton.TextScaled = true
  81. LockButton.Font = Enum.Font.GothamBold -- Match the font with StatusText
  82.  
  83. -- Add UI corner for button
  84. local ButtonUICorner = Instance.new("UICorner", LockButton)
  85. ButtonUICorner.CornerRadius = UDim.new(0, 15)
  86.  
  87. -- Add UI Gradient for button look
  88. local ButtonGradient = Instance.new("UIGradient", LockButton)
  89. ButtonGradient.Color = ColorSequence.new{
  90. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)), -- Match colors with StatusText
  91. ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 255))
  92. }
  93. ButtonGradient.Rotation = 90
  94.  
  95. -- Add text stroke to button
  96. LockButton.TextStrokeTransparency = 0.2
  97. LockButton.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  98.  
  99. -- Function to animate button when clicked
  100. local function animateButton()
  101. -- Scale up the button
  102. local scaleUp = TweenService:Create(
  103. LockButton,
  104. TweenInfo.new(0.1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out),
  105. {Size = UDim2.new(0, 220, 0, 60)}
  106. )
  107. -- Scale down the button back to its original size
  108. local scaleDown = TweenService:Create(
  109. LockButton,
  110. TweenInfo.new(0.1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out),
  111. {Size = UDim2.new(0, 200, 0, 50)}
  112. )
  113.  
  114. -- Play the animations in sequence
  115. scaleUp:Play()
  116. scaleUp.Completed:Wait() -- Wait for scaleUp to finish before scaling down
  117. scaleDown:Play()
  118. end
  119.  
  120. -- Function to handle button click
  121. LockButton.MouseButton1Click:Connect(function()
  122. animateButton() -- Play the animation when the button is clicked
  123. toggleLock() -- Toggle the lock/unlock functionality
  124. end)
  125.  
  126. return ScreenGui, StatusText
  127. end
  128.  
  129. -- Create the GUI initially
  130. local gui, StatusText = createGui()
  131.  
  132. -- Function to smoothly move the camera towards the target
  133. local function smoothCameraLock(targetPosition)
  134. local tween = TweenService:Create(
  135. camera,
  136. TweenInfo.new(0.01, Enum.EasingStyle.Linear),
  137. {CFrame = CFrame.new(camera.CFrame.Position, targetPosition)}
  138. )
  139. tween:Play()
  140. end
  141.  
  142. -- Function to lock the mouse to a player's body (HumanoidRootPart)
  143. local function lockMouseToPlayer(targetPlayer)
  144. lockedPlayer = targetPlayer
  145. isLocked = true
  146. mouse.Icon = "rbxassetid://20329976" -- Optional: Change the mouse icon to indicate lock-on
  147.  
  148. -- Update the status text
  149. StatusText.Text = "Locking onto " .. targetPlayer.Name
  150.  
  151. -- Pulse animation for epic effect when locking onto a player
  152. TweenService:Create(gui.StatusFrame, TweenInfo.new(0.3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {
  153. Size = UDim2.new(0, 420, 0, 90)
  154. }):Play()
  155. wait(0.3)
  156. TweenService:Create(gui.StatusFrame, TweenInfo.new(0.3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {
  157. Size = UDim2.new(0, 400, 0, 70)
  158. }):Play()
  159.  
  160. RunService.RenderStepped:Connect(function()
  161. if isLocked and lockedPlayer and lockedPlayer.Character and lockedPlayer.Character:FindFirstChild("HumanoidRootPart") then
  162. local bodyPosition = lockedPlayer.Character.HumanoidRootPart.Position
  163. smoothCameraLock(bodyPosition)
  164.  
  165. -- Keep the camera locked onto the target's body
  166. UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
  167. UserInputService.MouseIconEnabled = true
  168. end
  169. end)
  170. end
  171.  
  172. -- Function to unlock the mouse
  173. local function unlockMouse()
  174. isLocked = false
  175. lockedPlayer = nil
  176. UserInputService.MouseBehavior = Enum.MouseBehavior.Default
  177. mouse.Icon = "" -- Reset the mouse icon
  178. StatusText.Text = "Finding player..." -- Update the GUI status
  179. end
  180.  
  181. -- Function to check for players near the mouse pointer
  182. local function checkForPlayers()
  183. for _, targetPlayer in pairs(Players:GetPlayers()) do
  184. if targetPlayer ~= player and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
  185. local targetPosition = targetPlayer.Character.HumanoidRootPart.Position
  186. local mousePosition = Vector3.new(mouse.Hit.X, mouse.Hit.Y, mouse.Hit.Z)
  187. local distance = (targetPosition - mousePosition).Magnitude
  188.  
  189. if distance <= lockDistance and targetPlayer ~= lockedPlayer then -- Check if the target is different
  190. return targetPlayer
  191. end
  192. end
  193. end
  194. return nil
  195. end
  196.  
  197. -- Function to toggle between locking and unlocking the mouse
  198. local function toggleLock()
  199. if isLocked then
  200. unlockMouse() -- If the mouse is currently locked, unlock it
  201. else
  202. local targetPlayer = checkForPlayers() -- Check if there's a player to lock onto
  203. if targetPlayer then
  204. lockMouseToPlayer(targetPlayer) -- If a player is found, lock onto them
  205. end
  206. end
  207. end
  208.  
  209. -- Listen for the G key to toggle lock/unlock
  210. UserInputService.InputBegan:Connect(function(input)
  211. if input.KeyCode == Enum.KeyCode.G then
  212. toggleLock()
  213. end
  214. end)
  215.  
  216. -- Continuously check if the locked player is killed
  217. RunService.RenderStepped:Connect(function()
  218. if isLocked and lockedPlayer and lockedPlayer.Character then
  219. local humanoid = lockedPlayer.Character:FindFirstChild("Humanoid")
  220. if humanoid and humanoid.Health <= 0 then
  221. unlockMouse() -- Unlock the mouse if the opponent is killed
  222. end
  223. end
  224. end)
Advertisement
Add Comment
Please, Sign In to add comment