Advertisement
PowerMartin

aimbot..

Mar 26th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.32 KB | None | 0 0
  1. PLAYER = game.Players.LocalPlayer
  2. MOUSE = PLAYER:GetMouse()
  3. CC = game.Workspace.CurrentCamera
  4.  
  5. ENABLED = false
  6. ESP_ENABLED = false
  7.  
  8. _G.FREE_FOR_ALL = true
  9.  
  10. _G.BIND = 50
  11. _G.ESP_BIND = 52
  12. _G.CHANGE_AIM = 'q'
  13.  
  14. _G.AIM_AT = 'Head'
  15.  
  16. wait(1)
  17.  
  18. function GetNearestPlayerToMouse()
  19. local PLAYERS = {}
  20. local PLAYER_HOLD = {}
  21. local DISTANCES = {}
  22. for i, v in pairs(game.Players:GetPlayers()) do
  23. if v ~= PLAYER then
  24. table.insert(PLAYERS, v)
  25. end
  26. end
  27. for i, v in pairs(PLAYERS) do
  28. if _G.FREE_FOR_ALL == false then
  29. if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
  30. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  31. if AIM ~= nil then
  32. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  33. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  34. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  35. local DIFF = math.floor((POS - AIM.Position).magnitude)
  36. PLAYER_HOLD[v.Name .. i] = {}
  37. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  38. PLAYER_HOLD[v.Name .. i].plr = v
  39. PLAYER_HOLD[v.Name .. i].diff = DIFF
  40. table.insert(DISTANCES, DIFF)
  41. end
  42. end
  43. elseif _G.FREE_FOR_ALL == true then
  44. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  45. if AIM ~= nil then
  46. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  47. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  48. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  49. local DIFF = math.floor((POS - AIM.Position).magnitude)
  50. PLAYER_HOLD[v.Name .. i] = {}
  51. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  52. PLAYER_HOLD[v.Name .. i].plr = v
  53. PLAYER_HOLD[v.Name .. i].diff = DIFF
  54. table.insert(DISTANCES, DIFF)
  55. end
  56. end
  57. end
  58.  
  59. if unpack(DISTANCES) == nil then
  60. return false
  61. end
  62.  
  63. local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  64. if L_DISTANCE > 20 then
  65. return false
  66. end
  67.  
  68. for i, v in pairs(PLAYER_HOLD) do
  69. if v.diff == L_DISTANCE then
  70. return v.plr
  71. end
  72. end
  73. return false
  74. end
  75.  
  76. GUI_MAIN = Instance.new('ScreenGui', game.CoreGui)
  77. GUI_TARGET = Instance.new('TextLabel', GUI_MAIN)
  78. GUI_AIM_AT = Instance.new('TextLabel', GUI_MAIN)
  79.  
  80. GUI_MAIN.Name = 'AIMBOT'
  81.  
  82. GUI_TARGET.Size = UDim2.new(0,200,0,30)
  83. GUI_TARGET.BackgroundTransparency = 0.5
  84. GUI_TARGET.BackgroundColor = BrickColor.new('Fossil')
  85. GUI_TARGET.BorderSizePixel = 0
  86. GUI_TARGET.Position = UDim2.new(0.5,-100,0,0)
  87. GUI_TARGET.Text = 'AIMBOT : OFF'
  88. GUI_TARGET.TextColor3 = Color3.new(1,1,1)
  89. GUI_TARGET.TextStrokeTransparency = 1
  90. GUI_TARGET.TextWrapped = true
  91. GUI_TARGET.FontSize = 'Size24'
  92. GUI_TARGET.Font = 'SourceSansBold'
  93.  
  94. GUI_AIM_AT.Size = UDim2.new(0,200,0,20)
  95. GUI_AIM_AT.BackgroundTransparency = 0.5
  96. GUI_AIM_AT.BackgroundColor = BrickColor.new('Fossil')
  97. GUI_AIM_AT.BorderSizePixel = 0
  98. GUI_AIM_AT.Position = UDim2.new(0.5,-100,0,30)
  99. GUI_AIM_AT.Text = 'AIMING : HEAD'
  100. GUI_AIM_AT.TextColor3 = Color3.new(1,1,1)
  101. GUI_AIM_AT.TextStrokeTransparency = 1
  102. GUI_AIM_AT.TextWrapped = true
  103. GUI_AIM_AT.FontSize = 'Size18'
  104. GUI_AIM_AT.Font = 'SourceSansBold'
  105.  
  106. local TRACK = false
  107.  
  108. function CREATE(BASE, TEAM)
  109. local ESP_MAIN = Instance.new('BillboardGui', PLAYER.PlayerGui)
  110. local ESP_DOT = Instance.new('Frame', ESP_MAIN)
  111. local ESP_NAME = Instance.new('TextLabel', ESP_MAIN)
  112.  
  113. ESP_MAIN.Name = 'ESP'
  114. ESP_MAIN.Adornee = BASE
  115. ESP_MAIN.AlwaysOnTop = true
  116. ESP_MAIN.ExtentsOffset = Vector3.new(0, 1, 0)
  117. ESP_MAIN.Size = UDim2.new(0, 5, 0, 5)
  118.  
  119. ESP_DOT.Name = 'DOT'
  120. ESP_DOT.BackgroundColor = BrickColor.new('Bright red')
  121. ESP_DOT.BackgroundTransparency = 0.3
  122. ESP_DOT.BorderSizePixel = 0
  123. ESP_DOT.Position = UDim2.new(-0.5, 0, -0.5, 0)
  124. ESP_DOT.Size = UDim2.new(2, 0, 2, 0)
  125. ESP_DOT.Visible = true
  126. ESP_DOT.ZIndex = 10
  127.  
  128. ESP_NAME.Name = 'NAME'
  129. ESP_NAME.BackgroundColor3 = Color3.new(255, 255, 255)
  130. ESP_NAME.BackgroundTransparency = 1
  131. ESP_NAME.BorderSizePixel = 0
  132. ESP_NAME.Position = UDim2.new(0, 0, 0, -40)
  133. ESP_NAME.Size = UDim2.new(1, 0, 10, 0)
  134. ESP_NAME.Visible = true
  135. ESP_NAME.ZIndex = 10
  136. ESP_NAME.Font = 'ArialBold'
  137. ESP_NAME.FontSize = 'Size14'
  138. ESP_NAME.Text = BASE.Parent.Name:upper()
  139. ESP_NAME.TextColor = BrickColor.new('Bright red')
  140. end
  141.  
  142. function CLEAR()
  143. for _,v in pairs(PLAYER.PlayerGui:children()) do
  144. if v.Name == 'ESP' and v:IsA('BillboardGui') then
  145. v:Destroy()
  146. end
  147. end
  148. end
  149.  
  150. function FIND()
  151. CLEAR()
  152. TRACK = true
  153. spawn(function()
  154. while wait() do
  155. if TRACK then
  156. CLEAR()
  157. for i,v in pairs(game.Players:GetChildren()) do
  158. if v.Character and v.Character:FindFirstChild('Head') then
  159. if _G.FREE_FOR_ALL == false then
  160. if v.TeamColor ~= PLAYER.TeamColor then
  161. if v.Character:FindFirstChild('Head') then
  162. CREATE(v.Character.Head, true)
  163. end
  164. end
  165. else
  166. if v.Character:FindFirstChild('Head') then
  167. CREATE(v.Character.Head, true)
  168. end
  169. end
  170. end
  171. end
  172. end
  173. end
  174. wait(1)
  175. end)
  176. end
  177.  
  178. MOUSE.KeyDown:connect(function(KEY)
  179. KEY = KEY:lower():byte()
  180. if KEY == _G.BIND then
  181. ENABLED = true
  182. end
  183. end)
  184.  
  185. MOUSE.KeyUp:connect(function(KEY)
  186. KEY = KEY:lower():byte()
  187. if KEY == _G.BIND then
  188. ENABLED = false
  189. end
  190. end)
  191.  
  192. MOUSE.KeyDown:connect(function(KEY)
  193. KEY = KEY:lower():byte()
  194. if KEY == _G.ESP_BIND then
  195. if ESP_ENABLED == false then
  196. FIND()
  197. ESP_ENABLED = true
  198. print('ESP : ON')
  199. elseif ESP_ENABLED == true then
  200. wait()
  201. CLEAR()
  202. TRACK = false
  203. ESP_ENABLED = true
  204. print('ESP : OFF')
  205. end
  206. end
  207. end)
  208.  
  209. MOUSE.KeyDown:connect(function(KEY)
  210. if KEY == _G.CHANGE_AIM then
  211. if _G.AIM_AT == 'Head' then
  212. _G.AIM_AT = 'Torso'
  213. GUI_AIM_AT.Text = 'AIMING : TORSO'
  214. elseif _G.AIM_AT == 'Torso' then
  215. _G.AIM_AT = 'Head'
  216. GUI_AIM_AT.Text = 'AIMING : HEAD'
  217. end
  218. end
  219. end)
  220.  
  221. game:GetService('RunService').RenderStepped:connect(function()
  222. if ENABLED then
  223. local TARGET = GetNearestPlayerToMouse()
  224. if (TARGET ~= false) then
  225. local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
  226. if AIM then
  227. CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
  228. end
  229. GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
  230. else
  231. PLAYER = game.Players.LocalPlayer
  232. MOUSE = PLAYER:GetMouse()
  233. CC = game.Workspace.CurrentCamera
  234.  
  235. ENABLED = false
  236. ESP_ENABLED = false
  237.  
  238. _G.FREE_FOR_ALL = true
  239.  
  240. _G.BIND = 50
  241. _G.ESP_BIND = 52
  242. _G.CHANGE_AIM = 'q'
  243.  
  244. _G.AIM_AT = 'Head'
  245.  
  246. wait(1)
  247.  
  248. function GetNearestPlayerToMouse()
  249. local PLAYERS = {}
  250. local PLAYER_HOLD = {}
  251. local DISTANCES = {}
  252. for i, v in pairs(game.Players:GetPlayers()) do
  253. if v ~= PLAYER then
  254. table.insert(PLAYERS, v)
  255. end
  256. end
  257. for i, v in pairs(PLAYERS) do
  258. if _G.FREE_FOR_ALL == false then
  259. if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
  260. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  261. if AIM ~= nil then
  262. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  263. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  264. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  265. local DIFF = math.floor((POS - AIM.Position).magnitude)
  266. PLAYER_HOLD[v.Name .. i] = {}
  267. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  268. PLAYER_HOLD[v.Name .. i].plr = v
  269. PLAYER_HOLD[v.Name .. i].diff = DIFF
  270. table.insert(DISTANCES, DIFF)
  271. end
  272. end
  273. elseif _G.FREE_FOR_ALL == true then
  274. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  275. if AIM ~= nil then
  276. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  277. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  278. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  279. local DIFF = math.floor((POS - AIM.Position).magnitude)
  280. PLAYER_HOLD[v.Name .. i] = {}
  281. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  282. PLAYER_HOLD[v.Name .. i].plr = v
  283. PLAYER_HOLD[v.Name .. i].diff = DIFF
  284. table.insert(DISTANCES, DIFF)
  285. end
  286. end
  287. end
  288.  
  289. if unpack(DISTANCES) == nil then
  290. return false
  291. end
  292.  
  293. local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  294. if L_DISTANCE > 20 then
  295. return false
  296. end
  297.  
  298. for i, v in pairs(PLAYER_HOLD) do
  299. if v.diff == L_DISTANCE then
  300. return v.plr
  301. end
  302. end
  303. return false
  304. end
  305.  
  306. GUI_MAIN = Instance.new('ScreenGui', game.CoreGui)
  307. GUI_TARGET = Instance.new('TextLabel', GUI_MAIN)
  308. GUI_AIM_AT = Instance.new('TextLabel', GUI_MAIN)
  309.  
  310. GUI_MAIN.Name = 'AIMBOT'
  311.  
  312. GUI_TARGET.Size = UDim2.new(0,200,0,30)
  313. GUI_TARGET.BackgroundTransparency = 0.5
  314. GUI_TARGET.BackgroundColor = BrickColor.new('Fossil')
  315. GUI_TARGET.BorderSizePixel = 0
  316. GUI_TARGET.Position = UDim2.new(0.5,-100,0,0)
  317. GUI_TARGET.Text = 'AIMBOT : OFF'
  318. GUI_TARGET.TextColor3 = Color3.new(1,1,1)
  319. GUI_TARGET.TextStrokeTransparency = 1
  320. GUI_TARGET.TextWrapped = true
  321. GUI_TARGET.FontSize = 'Size24'
  322. GUI_TARGET.Font = 'SourceSansBold'
  323.  
  324. GUI_AIM_AT.Size = UDim2.new(0,200,0,20)
  325. GUI_AIM_AT.BackgroundTransparency = 0.5
  326. GUI_AIM_AT.BackgroundColor = BrickColor.new('Fossil')
  327. GUI_AIM_AT.BorderSizePixel = 0
  328. GUI_AIM_AT.Position = UDim2.new(0.5,-100,0,30)
  329. GUI_AIM_AT.Text = 'AIMING : HEAD'
  330. GUI_AIM_AT.TextColor3 = Color3.new(1,1,1)
  331. GUI_AIM_AT.TextStrokeTransparency = 1
  332. GUI_AIM_AT.TextWrapped = true
  333. GUI_AIM_AT.FontSize = 'Size18'
  334. GUI_AIM_AT.Font = 'SourceSansBold'
  335.  
  336. local TRACK = false
  337.  
  338. function CREATE(BASE, TEAM)
  339. local ESP_MAIN = Instance.new('BillboardGui', PLAYER.PlayerGui)
  340. local ESP_DOT = Instance.new('Frame', ESP_MAIN)
  341. local ESP_NAME = Instance.new('TextLabel', ESP_MAIN)
  342.  
  343. ESP_MAIN.Name = 'ESP'
  344. ESP_MAIN.Adornee = BASE
  345. ESP_MAIN.AlwaysOnTop = true
  346. ESP_MAIN.ExtentsOffset = Vector3.new(0, 1, 0)
  347. ESP_MAIN.Size = UDim2.new(0, 5, 0, 5)
  348.  
  349. ESP_DOT.Name = 'DOT'
  350. ESP_DOT.BackgroundColor = BrickColor.new('Bright red')
  351. ESP_DOT.BackgroundTransparency = 0.3
  352. ESP_DOT.BorderSizePixel = 0
  353. ESP_DOT.Position = UDim2.new(-0.5, 0, -0.5, 0)
  354. ESP_DOT.Size = UDim2.new(2, 0, 2, 0)
  355. ESP_DOT.Visible = true
  356. ESP_DOT.ZIndex = 10
  357.  
  358. ESP_NAME.Name = 'NAME'
  359. ESP_NAME.BackgroundColor3 = Color3.new(255, 255, 255)
  360. ESP_NAME.BackgroundTransparency = 1
  361. ESP_NAME.BorderSizePixel = 0
  362. ESP_NAME.Position = UDim2.new(0, 0, 0, -40)
  363. ESP_NAME.Size = UDim2.new(1, 0, 10, 0)
  364. ESP_NAME.Visible = true
  365. ESP_NAME.ZIndex = 10
  366. ESP_NAME.Font = 'ArialBold'
  367. ESP_NAME.FontSize = 'Size14'
  368. ESP_NAME.Text = BASE.Parent.Name:upper()
  369. ESP_NAME.TextColor = BrickColor.new('Bright red')
  370. end
  371.  
  372. function CLEAR()
  373. for _,v in pairs(PLAYER.PlayerGui:children()) do
  374. if v.Name == 'ESP' and v:IsA('BillboardGui') then
  375. v:Destroy()
  376. end
  377. end
  378. end
  379.  
  380. function FIND()
  381. CLEAR()
  382. TRACK = true
  383. spawn(function()
  384. while wait() do
  385. if TRACK then
  386. CLEAR()
  387. for i,v in pairs(game.Players:GetChildren()) do
  388. if v.Character and v.Character:FindFirstChild('Head') then
  389. if _G.FREE_FOR_ALL == false then
  390. if v.TeamColor ~= PLAYER.TeamColor then
  391. if v.Character:FindFirstChild('Head') then
  392. CREATE(v.Character.Head, true)
  393. end
  394. end
  395. else
  396. if v.Character:FindFirstChild('Head') then
  397. CREATE(v.Character.Head, true)
  398. end
  399. end
  400. end
  401. end
  402. end
  403. end
  404. wait(1)
  405. end)
  406. end
  407.  
  408. MOUSE.KeyDown:connect(function(KEY)
  409. KEY = KEY:lower():byte()
  410. if KEY == _G.BIND then
  411. ENABLED = true
  412. end
  413. end)
  414.  
  415. MOUSE.KeyUp:connect(function(KEY)
  416. KEY = KEY:lower():byte()
  417. if KEY == _G.BIND then
  418. ENABLED = false
  419. end
  420. end)
  421.  
  422. MOUSE.KeyDown:connect(function(KEY)
  423. KEY = KEY:lower():byte()
  424. if KEY == _G.ESP_BIND then
  425. if ESP_ENABLED == false then
  426. FIND()
  427. ESP_ENABLED = true
  428. print('ESP : ON')
  429. elseif ESP_ENABLED == true then
  430. wait()
  431. CLEAR()
  432. TRACK = false
  433. ESP_ENABLED = true
  434. print('ESP : OFF')
  435. end
  436. end
  437. end)
  438.  
  439. MOUSE.KeyDown:connect(function(KEY)
  440. if KEY == _G.CHANGE_AIM then
  441. if _G.AIM_AT == 'Head' then
  442. _G.AIM_AT = 'Torso'
  443. GUI_AIM_AT.Text = 'AIMING : TORSO'
  444. elseif _G.AIM_AT == 'Torso' then
  445. _G.AIM_AT = 'Head'
  446. GUI_AIM_AT.Text = 'AIMING : HEAD'
  447. end
  448. end
  449. end)
  450.  
  451. game:GetService('RunService').RenderStepped:connect(function()
  452. if ENABLED then
  453. local TARGET = GetNearestPlayerToMouse()
  454. if (TARGET ~= false) then
  455. local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
  456. if AIM then
  457. CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
  458. end
  459. GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
  460. else
  461. GUI_TARGET.Text = 'AIMBOT : OFF'
  462. end
  463. end
  464. end)
  465.  
  466. repeat
  467. wait()
  468. if ESP_ENABLED == true then
  469. FIND()
  470. end
  471. until ESP_ENABLED == false
  472. wait()
  473. _G.FREE_FOR_ALL = true
  474. _G.BIND = 50 -- LEFT CTRL
  475. _G.ESP_BIND = 52 -- LEFT ALT GUI_TARGET.Text = 'AIMBOT : OFF'
  476. end
  477. end
  478. end)
  479.  
  480. repeat
  481. wait()
  482. if ESP_ENABLED == true then
  483. FIND()
  484. end
  485. until ESP_ENABLED == false
  486. wait()
  487. _G.FREE_FOR_ALL = true
  488. _G.BIND = 50 -- LEFT CTRL
  489. _G.ESP_BIND = 52 -- LEFT ALT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement