Advertisement
SigmaBoy456

Aimbot GUI v3 by MawinCK

Oct 7th, 2024 (edited)
1,466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.94 KB | None | 0 0
  1. --print("Hello, World!")
  2. --print("Hello, World!")
  3. local setting = {
  4. mode = "closest", -- opp is FOV
  5. teamcheck = false,
  6. wallcheck = false,
  7. checknpc = false,
  8. aimbot = false,
  9. aimpart = "HumanoidRootPart"
  10. }
  11.  
  12. local player = game.Players.LocalPlayer
  13. local character = player.Character
  14. local localroot = character:WaitForChild("HumanoidRootPart")
  15. local head = character:WaitForChild("Head")
  16. local Cam = workspace.CurrentCamera
  17. local centerCam = workspace.CurrentCamera.ViewportSize
  18.  
  19. game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
  20. character = char
  21. localroot = character:WaitForChild("HumanoidRootPart")
  22. head = character:WaitForChild("Head")
  23. end)
  24.  
  25. local function closest()
  26. local range = 9999
  27. local target = nil
  28. for _, v in pairs(game.Players:GetPlayers()) do
  29. if v ~= player and v.Character and not v.Character:FindFirstChildWhichIsA("ForceField") then
  30. if not setting.teamcheck or v.Team ~= player.Team then
  31. local AS = v.Character:FindFirstChild("HumanoidRootPart")
  32. local ASD = v.Character:FindFirstChildOfClass("Humanoid")
  33. if AS and ASD.Health > 0 then
  34. local dist = (localroot.Position - AS.Position).magnitude
  35. if dist < range then
  36. range = dist
  37. target = v
  38. end
  39. end
  40. end
  41. end
  42. end
  43. return target
  44. end
  45.  
  46.  
  47. local function closest_check()
  48. local BH = closest()
  49. if BH and BH.Character and BH.Character:FindFirstChild("HumanoidRootPart") then
  50. local JKS = BH.Character:FindFirstChild("HumanoidRootPart")
  51. local direction = (JKS.Position - head.Position).unit * 1000
  52. local rayset = RaycastParams.new()
  53. rayset.FilterType = Enum.RaycastFilterType.Blacklist
  54. rayset.FilterDescendantsInstances = {character}
  55. rayset.IgnoreWater = true
  56. local result = workspace:Raycast(head.Position, direction, rayset)
  57. if result and result.Instance:IsDescendantOf(BH.Character) then
  58. return BH
  59. end
  60. end
  61. return nil
  62. end
  63.  
  64. local function closest_npc()
  65. local range = 9999
  66. local target = nil
  67. for _, v in pairs(game.Workspace:GetDescendants()) do
  68. if v:IsA("Model") and v:FindFirstChild("HumanoidRootPart") and not game.Players:FindFirstChild(v.Name) then
  69. local vroot = v:FindFirstChild("HumanoidRootPart")
  70. local vhum = v:FindFirstChildOfClass("Humanoid")
  71. if vhum.Health > 0 then
  72. local dist = (localroot.Position - vroot.Position).magnitude
  73. if dist < range then
  74. range = dist
  75. target = v
  76. end
  77. end
  78. end
  79. end
  80. return target
  81. end
  82.  
  83.  
  84. local function closest_npc_check()
  85. if closest_npc() and closest_npc():FindFirstChild("HumanoidRootPart") then
  86. local CH = closest_npc():FindFirstChild("HumanoidRootPart")
  87. local directionJH = (CH.Position - head.Position).unit * 1000
  88. local rayset = RaycastParams.new()
  89. rayset.FilterType = Enum.RaycastFilterType.Blacklist
  90. rayset.FilterDescendantsInstances = {character}
  91. rayset.IgnoreWater = true
  92. local result_npc = workspace:Raycast(head.Position, directionJH, rayset)
  93. if result_npc and result_npc.Instance:IsDescendantOf(closest_npc()) then
  94. return closest_npc()
  95. end
  96. end
  97. return nil
  98. end
  99.  
  100. if game.CoreGui:FindFirstChild("GUI") then
  101. game.CoreGui:FindFirstChild("GUI"):Destroy()
  102. end
  103.  
  104. local GUI = Instance.new("ScreenGui", game.CoreGui)
  105. GUI.Name = "GUI"
  106. local mainF = Instance.new("Frame", GUI)
  107. mainF.Size = UDim2.new(0, 150, 0, 100)
  108. mainF.Position = UDim2.new(0, 100, 0, 0)
  109. mainF.Name = "My frame"
  110. mainF.BackgroundColor3 = Color3.new(1, 1, 1)
  111. mainF.Active = true
  112. mainF.Draggable = true
  113.  
  114. local title = Instance.new("TextLabel", mainF)
  115. title.Size = UDim2.new(0, 150, 0, 20)
  116. title.Position = UDim2.new(0, 0, 0, 0)
  117. title.Name = "My Title"
  118. title.BackgroundColor3 = Color3.new(1, 1, 1)
  119. title.Text = "Aimbot GUI v3 by MawinCK"
  120. title.TextScaled = true
  121. title.TextWrapped= true
  122.  
  123. local aimbotTOGGLE = Instance.new("TextButton", mainF)
  124. aimbotTOGGLE.Size = UDim2.new(0, 150, 0, 20)
  125. aimbotTOGGLE.Position = UDim2.new(0, 0, 0, 20)
  126. aimbotTOGGLE.Name = "My aimbot"
  127. aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(255, 17, 0) -- Red lmao
  128. aimbotTOGGLE.Text = "Aimbot: Off"
  129. aimbotTOGGLE.TextScaled = true
  130. aimbotTOGGLE.TextWrapped = true
  131.  
  132. -- Next
  133.  
  134. local teamC = Instance.new("TextButton", mainF) -- Team Lmao
  135. teamC.Size = UDim2.new(0, 150, 0, 20)
  136. teamC.Position = UDim2.new(0, 0, 0, 40)
  137. teamC.Name = "Team check Button"
  138. teamC.BackgroundColor3 = Color3.fromRGB(255, 17, 0) -- remember set 17 to 255 if want green(if i forget)
  139. teamC.Text = "TeamCheck: Off"
  140. teamC.TextScaled = true
  141. teamC.TextWrapped = true
  142.  
  143. local wallC = Instance.new("TextButton", mainF)
  144. wallC.Size = UDim2.new(0, 150, 0, 20)
  145. wallC.Position = UDim2.new(0, 0, 0, 60)
  146. wallC.Name = "Wall Check Button"
  147. wallC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  148. wallC.Text = "WallCheck: Off"
  149. wallC.TextScaled = true
  150. wallC.TextWrapped = true
  151.  
  152. -- Event For both WallCheck and TeamCheck
  153. teamC.MouseButton1Click:Connect(function()
  154. if not setting.teamcheck then
  155. teamC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
  156. teamC.Text = "TeamCheck: On"
  157. setting.teamcheck = true
  158. elseif setting.teamcheck then
  159. teamC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  160. teamC.Text = "TeamCheck: Off"
  161. setting.teamcheck = false
  162. end
  163. end)
  164.  
  165. wallC.MouseButton1Click:Connect(function()
  166. if not setting.wallcheck then
  167. wallC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
  168. wallC.Text = "WallCheck: On"
  169. setting.wallcheck = true
  170. elseif setting.wallcheck then
  171. wallC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  172. wallC.Text = "WallCheck: Off"
  173. setting.wallcheck = false
  174. end
  175. end)
  176.  
  177. -- Mode Switching
  178. local switch = Instance.new("TextButton", mainF)
  179. switch.Size = UDim2.new(0, 150, 0, 20)
  180. switch.Position = UDim2.new(0, 0, 0, 80)
  181. switch.Name = "Switch Team"
  182. switch.BackgroundColor3 = Color3.new(1, 1, 1)
  183. switch.Text = "Aimbot Mode: closest"
  184. switch.TextScaled = true
  185. switch.TextWrapped = true
  186.  
  187. switch.MouseButton1Click:Connect(function()
  188. if setting.mode == "closest" then
  189. setting.mode = "FOV"
  190. switch.Text = "Aimbot Mode: FOV"
  191. elseif setting.mode == "FOV" then
  192. setting.mode = "closest"
  193. switch.Text = "Aimbot Mode: closest"
  194. end
  195. end)
  196.  
  197. local fovrad = Instance.new("TextBox", mainF)
  198. fovrad.Size = UDim2.new(0, 150, 0, 20)
  199. fovrad.Position = UDim2.new(0, 0, 0, 100)
  200. fovrad.Name = "FOV changer"
  201. fovrad.BackgroundColor3 = Color3.new(1, 1, 1)
  202. fovrad.Text = "Input Amount of FOV Size Here"
  203. fovrad.TextScaled = true
  204. fovrad.TextWrapped = true
  205.  
  206. -- SetUp for FOV script Aimbot
  207.  
  208. local function IntFOV(def)
  209. if setting.mode == "FOV" then
  210. if def and def.Visible ~= true then
  211. def.Visible = true
  212. def.Radius = tonumber(fovrad.Text)
  213. end
  214. elseif setting.mode ~= "FOV" then
  215. def.Visible = false
  216. end
  217. end
  218.  
  219. local FOV = Drawing.new("Circle")
  220. FOV.Radius = 50
  221. FOV.Visible = false
  222. FOV.Position = centerCam / 2
  223. FOV.Color = Color3.new(1, 1, 1)
  224. FOV.Filled = false
  225. FOV.Thickness = 1
  226.  
  227. game:GetService("RunService").Heartbeat:Connect(function()
  228. FOV.Position = centerCam / 2
  229. end)
  230.  
  231. local function FOV_aimbot_plr() -- Replace def with Circle FOV name
  232. for _, v in pairs(game.Players:GetPlayers()) do
  233. if v ~= player and v.Character and setting.mode == "FOV" then
  234. if not setting.teamcheck or v.Team ~= player.Team then
  235. local vrootv = v.Character:FindFirstChild(setting.aimpart)
  236. local vhumv = v.Character:FindFirstChildOfClass("Humanoid")
  237. if vrootv and vhumv.Health > 0 then
  238. local OnPos, OnScreen = Cam:WorldToViewportPoint(vrootv.Position)
  239. if OnScreen then
  240. local distOnScreen = (Vector2.new(OnPos.X, OnPos.Y) - centerCam / 2).magnitude
  241. if distOnScreen < FOV.Radius then
  242. Cam.CFrame = CFrame.new(Cam.CFrame.Position, vrootv.Position)
  243. end
  244. end
  245. end
  246. end
  247. end
  248. end
  249. end
  250.  
  251. local function FOV_aimbot_npc()
  252. for _, v in pairs(game.Workspace:GetDescendants()) do
  253. if v:IsA("Model") and v:FindFirstChild(setting.aimpart) and not game.Players:FindFirstChild(v.Name) then
  254. local VZ = v:FindFirstChild(setting.aimpart)
  255. local ZC = v:FindFirstChildOfClass("Humanoid")
  256. if ZC.Health > 0 then
  257. local OnPosVZ, OnScreenVZ = Cam:WorldToViewportPoint(VZ.Position)
  258. if OnScreenVZ then
  259. local distOnScreenVZ = (Vector2.new(OnPosVZ.X, OnPosVZ.Y) - centerCam / 2).magnitude
  260. if distOnScreenVZ < FOV.Radius then
  261. Cam.CFrame = CFrame.new(Cam.CFrame.Position, VZ.Position)
  262. end
  263. end
  264. end
  265. end
  266. end
  267. end
  268.  
  269. local npcC = Instance.new("TextButton", mainF)
  270. npcC.Size = UDim2.new(0, 150, 0, 20)
  271. npcC.Position = UDim2.new(0, 0, 0, 120)
  272. npcC.Name = "My Npc Check Button"
  273. npcC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  274. npcC.Text = "Npc Targetting: Off"
  275. npcC.TextScaled = true
  276. npcC.TextWrapped = true
  277.  
  278. -- Event
  279. npcC.MouseButton1Click:Connect(function()
  280. if not setting.checknpc then
  281. setting.checknpc = true
  282. npcC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
  283. npcC.Text = "Npc Targetting: On"
  284. elseif setting.checknpc then
  285. setting.checknpc = false
  286. npcC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  287. npcC.Text = "Npc Targetting: Off"
  288. end
  289. end)
  290.  
  291. local change = Instance.new("TextButton", mainF)
  292. change.Size = UDim2.new(0, 150, 0, 20)
  293. change.Position = UDim2.new(0, 0, 0, 140)
  294. change.Name = "Change Button"
  295. change.Text = "Aimbot Aiming: HumanoidRootPart"
  296. change.TextScaled = true
  297. change.TextWrapped = true
  298.  
  299. change.MouseButton1Click:Connect(function()
  300. if setting.aimpart == "HumanoidRootPart" then
  301. setting.aimpart = "Head"
  302. change.Text = "Aimbot Aiming: Head"
  303. elseif setting.aimpart == "Head" then
  304. setting.aimpart = "HumanoidRootPart"
  305. change.Text = "Aimbot Aiming: HumanoidRootPart"
  306. end
  307. end)
  308.  
  309. -- Final Event and Scripting
  310. aimbotTOGGLE.MouseButton1Click:Connect(function()
  311. if not setting.aimbot then
  312. setting.aimbot = true
  313. aimbotTOGGLE.Text = "Aimbot: On"
  314. aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
  315. if not setting.wallcheck and not setting.checknpc and setting.mode == "closest" then
  316. repeat
  317. game:GetService("RunService").Heartbeat:Wait()
  318. local targeter = closest()
  319. if targeter and targeter.Character and targeter.Character:FindFirstChild(setting.aimpart) then
  320. local HS = targeter.Character:FindFirstChild(setting.aimpart)
  321. Cam.CFrame = CFrame.new(Cam.CFrame.Position, HS.Position)
  322. end
  323. until setting.wallcheck or setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
  324. elseif setting.wallcheck and not setting.checknpc and setting.mode == "closest" then -- Lmao
  325. repeat
  326. game:GetService("RunService").Heartbeat:Wait()
  327. local targeted = closest_check()
  328. if targeted and targeted.Character and targeted.Character:FindFirstChild(setting.aimpart) then
  329. local JK = targeted.Character:FindFirstChild(setting.aimpart)
  330. Cam.CFrame = CFrame.new(Cam.CFrame.Position, JK.Position)
  331. end
  332. until not setting.wallcheck or setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
  333. elseif not setting.wallcheck and setting.checknpc and setting.mode == "closest" then
  334. repeat
  335. game:GetService("RunService").Heartbeat:Wait()
  336. if closest_npc() and closest_npc():FindFirstChild(setting.aimpart) then
  337. local FG = closest_npc():FindFirstChild(setting.aimpart)
  338. Cam.CFrame = CFrame.new(Cam.CFrame.Position, FG.Position)
  339. end
  340. until not setting.aimbot or not setting.checknpc or setting.mode ~= "closest" or setting.wallcheck
  341. elseif setting.wallcheck and setting.checknpc and setting.mode == "closest" then
  342. repeat
  343. game:GetService("RunService").Heartbeat:Wait()
  344.  
  345. if closest_npc_check() and closest_npc_check():FindFirstChild(setting.aimpart) then
  346. local RU = closest_npc_check():FindFirstChild(setting.aimpart)
  347. Cam.CFrame = CFrame.new(Cam.CFrame.Position, RU.Position)
  348. end
  349. until not setting.wallcheck or not setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
  350. elseif not setting.wallcheck and not setting.checknpc and setting.mode == "FOV" then
  351. repeat
  352. game:GetService("RunService").Heartbeat:Wait()
  353. IntFOV(FOV)
  354. FOV_aimbot_plr()
  355. until setting.wallcheck or setting.checknpc or setting.mode ~= "FOV" or not setting.aimbot
  356. elseif not setting.wallcheck and setting.checknpc and setting.mode == "FOV" then
  357. repeat
  358. game:GetService("RunService").Heartbeat:Wait()
  359. IntFOV(FOV)
  360. FOV_aimbot_npc()
  361. until setting.wallcheck or not setting.checknpc or setting.mode ~= "FOV" or not setting.aimbot
  362. end
  363. elseif setting.aimbot then
  364. aimbotTOGGLE.Text = "Aimbot: Off"
  365. aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
  366. setting.aimbot = false
  367. FOV.Visible = false
  368. end
  369. end)
  370.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement