ZammyHamac

Aimbot Created By An Aj

Sep 1st, 2026
7
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. -- // ==========================================
  2. -- // SERVICES
  3. -- // ==========================================
  4. local Players = game:GetService("Players")
  5. local RunService = game:GetService("RunService")
  6. local UserInputService = game:GetService("UserInputService")
  7. local TweenService = game:GetService("TweenService")
  8.  
  9. -- // ==========================================
  10. -- // VARIABLES
  11. -- // ==========================================
  12. local LocalPlayer = Players.LocalPlayer
  13. local Camera = workspace.CurrentCamera
  14. local enabled = false
  15. local currentTarget = nil
  16. local SMOOTHING_FACTOR = 0.3 -- Lower = smoother/slower, Higher = snappier (0.1 to 1.0)
  17.  
  18. -- // ==========================================
  19. -- // GUI CREATION
  20. -- // ==========================================
  21. local ScreenGui = Instance.new("ScreenGui")
  22. local MainFrame = Instance.new("Frame")
  23. local TitleBar = Instance.new("Frame")
  24. local TitleText = Instance.new("TextLabel")
  25. local ToggleButton = Instance.new("TextButton")
  26. local CloseButton = Instance.new("TextButton")
  27.  
  28. -- Configure ScreenGui
  29. ScreenGui.Name = "CameraLockGUI"
  30. ScreenGui.ResetOnSpawn = false
  31. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  32. ScreenGui.Parent = game.CoreGui -- Parent to CoreGui so it persists
  33.  
  34. -- Configure Main Frame
  35. MainFrame.Name = "MainFrame"
  36. MainFrame.Parent = ScreenGui
  37. MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 35)
  38. MainFrame.BorderColor3 = Color3.fromRGB(50, 50, 70)
  39. MainFrame.Position = UDim2.new(0.5, -100, 0.5, -75)
  40. MainFrame.Size = UDim2.new(0, 200, 0, 150)
  41. MainFrame.Active = true
  42. MainFrame.Draggable = true -- Makes the GUI draggable
  43.  
  44. -- Configure Title Bar
  45. TitleBar.Name = "TitleBar"
  46. TitleBar.Parent = MainFrame
  47. TitleBar.BackgroundColor3 = Color3.fromRGB(40, 40, 55)
  48. TitleBar.BorderSizePixel = 0
  49. TitleBar.Size = UDim2.new(1, 0, 0, 30)
  50.  
  51. TitleText.Name = "TitleText"
  52. TitleText.Parent = TitleBar
  53. TitleText.BackgroundTransparency = 1
  54. TitleText.Size = UDim2.new(1, 0, 1, 0)
  55. TitleText.Font = Enum.Font.GothamBold
  56. TitleText.Text = "Camera Lock"
  57. TitleText.TextColor3 = Color3.fromRGB(255, 255, 255)
  58. TitleText.TextSize = 14
  59.  
  60. -- Configure Toggle Button
  61. ToggleButton.Name = "ToggleButton"
  62. ToggleButton.Parent = MainFrame
  63. ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) -- Starts Red (Disabled)
  64. ToggleButton.BorderSizePixel = 0
  65. ToggleButton.Position = UDim2.new(0.5, -75, 0, 50)
  66. ToggleButton.Size = UDim2.new(0, 150, 0, 40)
  67. ToggleButton.Font = Enum.Font.GothamBold
  68. ToggleButton.Text = "DISABLED"
  69. ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  70. ToggleButton.TextSize = 16
  71. ToggleButton.AutoButtonColor = true
  72.  
  73. -- Configure Close Button
  74. CloseButton.Name = "CloseButton"
  75. CloseButton.Parent = TitleBar
  76. CloseButton.BackgroundTransparency = 1
  77. CloseButton.Position = UDim2.new(1, -25, 0, 0)
  78. CloseButton.Size = UDim2.new(0, 25, 0, 30)
  79. CloseButton.Font = Enum.Font.GothamBold
  80. CloseButton.Text = "X"
  81. CloseButton.TextColor3 = Color3.fromRGB(255, 100, 100)
  82. CloseButton.TextSize = 16
  83.  
  84. -- // ==========================================
  85. -- // GUI LOGIC
  86. -- // ==========================================
  87. local function updateToggleButton()
  88. if enabled then
  89. ToggleButton.Text = "ENABLED"
  90. ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50) -- Green
  91. else
  92. ToggleButton.Text = "DISABLED"
  93. ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) -- Red
  94. currentTarget = nil -- Reset target when disabled
  95. end
  96. end
  97.  
  98. ToggleButton.MouseButton1Click:Connect(function()
  99. enabled = not enabled
  100. updateToggleButton()
  101. end)
  102.  
  103. CloseButton.MouseButton1Click:Connect(function()
  104. ScreenGui:Destroy()
  105. end)
  106.  
  107. -- // ==========================================
  108. -- // CORE AIMBOT LOGIC
  109. -- // ==========================================
  110. local function getNearestAlivePlayer()
  111. local nearestPlayer = nil
  112. local shortestDistance = math.huge
  113.  
  114. local myCharacter = LocalPlayer.Character
  115. local myRoot = myCharacter and myCharacter:FindFirstChild("HumanoidRootPart")
  116.  
  117. if not myRoot then return nil end
  118.  
  119. for _, player in ipairs(Players:GetPlayers()) do
  120. if player ~= LocalPlayer and player.Character then
  121. local targetRoot = player.Character:FindFirstChild("HumanoidRootPart")
  122. local targetHumanoid = player.Character:FindFirstChild("Humanoid")
  123.  
  124. -- Check if target exists, has a humanoid, and is alive
  125. if targetRoot and targetHumanoid and targetHumanoid.Health > 0 then
  126. local distance = (myRoot.Position - targetRoot.Position).Magnitude
  127.  
  128. if distance < shortestDistance then
  129. shortestDistance = distance
  130. nearestPlayer = player
  131. end
  132. end
  133. end
  134. end
  135.  
  136. return nearestPlayer
  137. end
  138.  
  139. -- // ==========================================
  140. -- // RENDER LOOP (Runs every frame)
  141. -- // ==========================================
  142. RunService.RenderStepped:Connect(function()
  143. -- 1. If disabled, do nothing
  144. if not enabled then return end
  145.  
  146. local myCharacter = LocalPlayer.Character
  147. if not myCharacter or not myCharacter:FindFirstChild("HumanoidRootPart") then return end
  148.  
  149. -- 2. Check if current target died or disconnected
  150. if currentTarget then
  151. local targetChar = currentTarget.Character
  152. local targetHum = targetChar and targetChar:FindFirstChild("Humanoid")
  153.  
  154. if not targetHum or targetHum.Health <= 0 then
  155. currentTarget = nil
  156. end
  157. end
  158.  
  159. -- 3. Find a new target if we don't have one
  160. if not currentTarget then
  161. currentTarget = getNearestAlivePlayer()
  162. end
  163.  
  164. -- 4. Point camera at the target
  165. if currentTarget and currentTarget.Character then
  166. local targetAimPart = currentTarget.Character:FindFirstChild("Head")
  167. or currentTarget.Character:FindFirstChild("HumanoidRootPart")
  168.  
  169. if targetAimPart then
  170. -- Calculate the CFrame we want to look at
  171. local targetCFrame = CFrame.lookAt(Camera.CFrame.Position, targetAimPart.Position)
  172.  
  173. -- Apply Lerp for smooth camera movement (prevents violent first-person jitter)
  174. Camera.CFrame = Camera.CFrame:Lerp(targetCFrame, SMOOTHING_FACTOR)
  175. end
  176. end
  177. end)
  178.  
  179. print("Camera Lock GUI Loaded! Drag the window to move it.")
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment