Smartdumgood

GWQEGtreW

Dec 23rd, 2024
878
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.81 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local UserInputService = game:GetService("UserInputService")
  3. local RunService = game:GetService("RunService")
  4. local StarterGui = game:GetService("StarterGui")
  5.  
  6. -- Create Password GUI
  7. local ScreenGui = Instance.new("ScreenGui")
  8. ScreenGui.Name = "KeySystem"
  9. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  10.  
  11. local MainFrame = Instance.new("Frame")
  12. MainFrame.Name = "MainFrame"
  13. MainFrame.Size = UDim2.new(0, 300, 0, 200)
  14. MainFrame.Position = UDim2.new(0.5, -150, 0.5, -100)
  15. MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  16. MainFrame.Parent = ScreenGui
  17.  
  18. local TitleLabel = Instance.new("TextLabel")
  19. TitleLabel.Size = UDim2.new(1, 0, 0, 50)
  20. TitleLabel.Position = UDim2.new(0, 0, 0, 0)
  21. TitleLabel.BackgroundTransparency = 1
  22. TitleLabel.Text = "KEY"
  23. TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  24. TitleLabel.TextSize = 30
  25. TitleLabel.Font = Enum.Font.GothamBold
  26. TitleLabel.Parent = MainFrame
  27.  
  28. local KeyBox = Instance.new("TextBox")
  29. KeyBox.Size = UDim2.new(0.8, 0, 0, 40)
  30. KeyBox.Position = UDim2.new(0.1, 0, 0.4, 0)
  31. KeyBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  32. KeyBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. KeyBox.PlaceholderText = "Enter Key Here..."
  34. KeyBox.TextSize = 20
  35. KeyBox.Parent = MainFrame
  36.  
  37. local SubmitButton = Instance.new("TextButton")
  38. SubmitButton.Size = UDim2.new(0.8, 0, 0, 40)
  39. SubmitButton.Position = UDim2.new(0.1, 0, 0.7, 0)
  40. SubmitButton.BackgroundColor3 = Color3.fromRGB(0, 120, 255)
  41. SubmitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  42. SubmitButton.Text = "Submit"
  43. SubmitButton.TextSize = 20
  44. SubmitButton.Parent = MainFrame
  45.  
  46. -- Variables
  47. local aimbotEnabled = false
  48. local espEnabled = false
  49. local currentTarget = nil
  50. local scriptUnlocked = false
  51.  
  52. -- Status GUI (Initially hidden)
  53. local StatusGui = Instance.new("ScreenGui")
  54. StatusGui.Name = "AimbotStatus"
  55. StatusGui.Enabled = false
  56. StatusGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  57.  
  58. local StatusLabel = Instance.new("TextLabel")
  59. StatusLabel.Size = UDim2.new(0, 200, 0, 50)
  60. StatusLabel.Position = UDim2.new(1, -220, 0, 20)
  61. StatusLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  62. StatusLabel.BackgroundTransparency = 0.5
  63. StatusLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  64. StatusLabel.Text = "Aimbot: OFF"
  65. StatusLabel.TextSize = 20
  66. StatusLabel.Parent = StatusGui
  67.  
  68. -- ESP Functions
  69. local function createESP()
  70. for _, player in pairs(Players:GetPlayers()) do
  71. if player ~= Players.LocalPlayer and player.Character then
  72. if not player.Character:FindFirstChild("Highlight") then
  73. local highlight = Instance.new("Highlight")
  74. highlight.FillColor = Color3.fromRGB(0, 255, 0)
  75. highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
  76. highlight.Parent = player.Character
  77. end
  78. end
  79. end
  80. end
  81.  
  82. local function removeESP()
  83. for _, player in pairs(Players:GetPlayers()) do
  84. if player ~= Players.LocalPlayer and player.Character then
  85. local highlight = player.Character:FindFirstChild("Highlight")
  86. if highlight then
  87. highlight:Destroy()
  88. end
  89. end
  90. end
  91. end
  92.  
  93. -- Key System
  94. SubmitButton.MouseButton1Click:Connect(function()
  95. if KeyBox.Text == "subscribe" then
  96. scriptUnlocked = true
  97. ScreenGui:Destroy()
  98. StatusGui.Enabled = true
  99.  
  100. StarterGui:SetCore("SendNotification", {
  101. Title = "Success!",
  102. Text = "Aimbot Unlocked - Press E to toggle, B for ESP",
  103. Duration = 3
  104. })
  105. else
  106. StarterGui:SetCore("SendNotification", {
  107. Title = "Error",
  108. Text = "Invalid Key!",
  109. Duration = 2
  110. })
  111. KeyBox.Text = ""
  112. end
  113. end)
  114.  
  115. -- Aimbot Functions
  116. local function getClosestPlayer()
  117. if currentTarget and currentTarget.Character and
  118. currentTarget.Character:FindFirstChild("Humanoid") and
  119. currentTarget.Character.Humanoid.Health > 0 then
  120. return currentTarget
  121. end
  122.  
  123. local closest = nil
  124. local maxDistance = 1000
  125. local shortestDistance = maxDistance
  126.  
  127. for _, player in pairs(Players:GetPlayers()) do
  128. if player ~= Players.LocalPlayer and
  129. player.Character and
  130. player.Character:FindFirstChild("Humanoid") and
  131. player.Character.Humanoid.Health > 0 then
  132.  
  133. local distance = (player.Character.HumanoidRootPart.Position - Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
  134. if distance < shortestDistance then
  135. closest = player
  136. shortestDistance = distance
  137. end
  138. end
  139. end
  140.  
  141. currentTarget = closest
  142. return closest
  143. end
  144.  
  145. -- Input Handler
  146. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  147. if not scriptUnlocked then return end
  148. if gameProcessed then return end
  149.  
  150. if input.KeyCode == Enum.KeyCode.E then
  151. aimbotEnabled = not aimbotEnabled
  152. StatusLabel.Text = "Aimbot: " .. (aimbotEnabled and "ON" or "OFF")
  153. StatusLabel.BackgroundColor3 = aimbotEnabled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  154.  
  155. StarterGui:SetCore("SendNotification", {
  156. Title = "Aimbot",
  157. Text = aimbotEnabled and "Enabled" or "Disabled",
  158. Duration = 2
  159. })
  160. elseif input.KeyCode == Enum.KeyCode.B then
  161. espEnabled = not espEnabled
  162. if espEnabled then
  163. createESP()
  164. else
  165. removeESP()
  166. end
  167.  
  168. StarterGui:SetCore("SendNotification", {
  169. Title = "ESP",
  170. Text = espEnabled and "ESP Enabled" or "ESP Disabled",
  171. Duration = 2
  172. })
  173. end
  174. end)
  175.  
  176. -- ESP for new players
  177. Players.PlayerAdded:Connect(function(player)
  178. if espEnabled then
  179. player.CharacterAdded:Connect(function(character)
  180. if espEnabled then
  181. local highlight = Instance.new("Highlight")
  182. highlight.FillColor = Color3.fromRGB(0, 255, 0)
  183. highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
  184. highlight.Parent = character
  185. end
  186. end)
  187. end
  188. end)
  189.  
  190. -- Main Loop
  191. RunService.RenderStepped:Connect(function()
  192. if scriptUnlocked and aimbotEnabled then
  193. local target = getClosestPlayer()
  194. if target and target.Character and target.Character:FindFirstChild("Head") then
  195. workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position, target.Character.Head.Position)
  196. end
  197. end
  198. end)
  199.  
  200. -- Initial Notification
  201. StarterGui:SetCore("SendNotification", {
  202. Title = "Key System",
  203. Text = "Enter password: subscribe",
  204. Duration = 5
  205. })
  206.  
Add Comment
Please, Sign In to add comment