Advertisement
GoldCraftingHD

Aimbot

Aug 21st, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local AimbotUI = Instance.new("ScreenGui")
  7. local Aimbot = Instance.new("Frame")
  8. local Title = Instance.new("TextLabel")
  9. local Toggle = Instance.new("TextButton")
  10.  
  11. --Properties:
  12.  
  13. AimbotUI.Name = "AimbotUI"
  14. AimbotUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15.  
  16. Aimbot.Name = "Aimbot"
  17. Aimbot.Parent = AimbotUI
  18. Aimbot.BackgroundColor3 = Color3.fromRGB(58, 58, 58)
  19. Aimbot.Position = UDim2.new(0.103068449, 0, 0.353565991, 0)
  20. Aimbot.Size = UDim2.new(0, 122, 0, 162)
  21.  
  22. Title.Name = "Title"
  23. Title.Parent = Aimbot
  24. Title.BackgroundColor3 = Color3.fromRGB(27, 27, 27)
  25. Title.BorderSizePixel = 0
  26. Title.Size = UDim2.new(0, 122, 0, 50)
  27. Title.Font = Enum.Font.SourceSansBold
  28. Title.Text = "Aimbot"
  29. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  30. Title.TextSize = 27.000
  31.  
  32. Toggle.Name = "Toggle"
  33. Toggle.Parent = Aimbot
  34. Toggle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  35. Toggle.BorderSizePixel = 0
  36. Toggle.Position = UDim2.new(0, 0, 0.395061731, 0)
  37. Toggle.Size = UDim2.new(0, 122, 0, 50)
  38. Toggle.Font = Enum.Font.SourceSansBold
  39. Toggle.Text = "Off"
  40. Toggle.TextColor3 = Color3.fromRGB(255, 0, 0)
  41. Toggle.TextSize = 40.000
  42.  
  43. -- Scripts:
  44.  
  45. local function CNQUST_fake_script() -- Toggle.LocalScript
  46. local script = Instance.new('LocalScript', Toggle)
  47.  
  48. _G.aimbot = false
  49. local camera = game.Workspace.CurrentCamera
  50. local localplayer = game:GetService("Players").LocalPlayer
  51.  
  52. script.Parent.MouseButton1Click:Connect(function()
  53. if _G.aimbot == false then
  54. _G.aimbot = true
  55. script.Parent.TextColor3 = Color3.fromRGB(0,170,0)
  56. script.Parent.Text = "On"
  57. function closestplayer()
  58. local dist = math.huge -- math.huge means a really large number, 1M+.
  59. local target = nil --- nil means no value
  60. for i,v in pairs (game:GetService("Players"):GetPlayers()) do
  61. if v ~= localplayer then
  62. if v.Character and v.Character:FindFirstChild("Head") and v.TeamColor ~= localplayer.TeamColor and _G.aimbot and v.Character.Humanoid.Health > 0 then --- creating the checks
  63. local magnitude = (v.Character.Head.Position - localplayer.Character.Head.Position).magnitude
  64. if magnitude < dist then
  65. dist = magnitude
  66. target = v
  67. end
  68.  
  69. end
  70. end
  71. end
  72. return target
  73. end
  74.  
  75. else
  76. _G.aimbot = false
  77. script.Parent.TextColor3 = Color3.fromRGB(255,0,0)
  78. script.Parent.Text = "Off"
  79. end
  80. end)
  81.  
  82. local settings = {
  83. keybind = Enum.UserInputType.MouseButton2
  84. }
  85.  
  86. local UIS = game:GetService("UserInputService")
  87. local aiming = false --- this toggle will make it so we lock on to the person when we press our keybind
  88.  
  89. UIS.InputBegan:Connect(function(inp)
  90. if inp.UserInputType == settings.keybind then
  91. aiming = true
  92. end
  93. end)
  94.  
  95. UIS.InputEnded:Connect(function(inp)
  96. if inp.UserInputType == settings.keybind then ---- when we stop pressing the keybind it would unlock off the player
  97. aiming = false
  98. end
  99. end)
  100.  
  101. game:GetService("RunService").RenderStepped:Connect(function()
  102. if aiming then
  103. camera.CFrame = CFrame.new(camera.CFrame.Position,closestplayer().Character.Head.Position) -- locks into the HEAD
  104. end
  105. end)
  106. end
  107. coroutine.wrap(CNQUST_fake_script)()
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement