Upscalefanatic3

Aimbot For Any Roblox Game Script

Dec 11th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. GUI_TARGET.Text = 'AIMBOT : OFF'
  232. end
  233. end
  234. end)
  235.  
  236. repeat
  237. wait()
  238. if ESP_ENABLED == true then
  239. FIND()
  240. end
  241. until ESP_ENABLED == false
  242. wait()
  243. _G.FREE_FOR_ALL = true
  244. _G.BIND = 50 -- LEFT CTRL
  245. _G.ESP_BIND = 52 -- LEFT ALT
  246. RAW Paste Data
  247. PLAYER = game.Players.LocalPlayer
  248. MOUSE = PLAYER:GetMouse()
  249. CC = game.Workspace.CurrentCamera
  250.  
  251. ENABLED = false
  252.  
  253. ESP_ENABLED = false
  254.  
  255. _G.FREE_FOR_ALL = true
  256.  
  257. _G.BIND = 50
  258. _G.ESP_BIND = 52
  259. _G.CHANGE_AIM = 'q'
  260.  
  261. _G.AIM_AT = 'Head'
  262.  
  263. wait(1)
  264.  
  265. function GetNearestPlayerToMouse()
  266. local PLAYERS = {}
  267. local PLAYER_HOLD = {}
  268. local DISTANCES = {}
  269. for i, v in pairs(game.Players:GetPlayers()) do
  270. if v ~= PLAYER then
  271. table.insert(PLAYERS, v)
  272. end
  273. end
  274. for i, v in pairs(PLAYERS) do
  275. if _G.FREE_FOR_ALL == false then
  276. if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
  277. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  278. if AIM ~= nil then
  279. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  280. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  281. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  282. local DIFF = math.floor((POS - AIM.Position).magnitude)
  283. PLAYER_HOLD[v.Name .. i] = {}
  284. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  285. PLAYER_HOLD[v.Name .. i].plr = v
  286. PLAYER_HOLD[v.Name .. i].diff = DIFF
  287. table.insert(DISTANCES, DIFF)
  288. end
  289. end
  290. elseif _G.FREE_FOR_ALL == true then
  291. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  292. if AIM ~= nil then
  293. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  294. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  295. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  296. local DIFF = math.floor((POS - AIM.Position).magnitude)
  297. PLAYER_HOLD[v.Name .. i] = {}
  298. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  299. PLAYER_HOLD[v.Name .. i].plr = v
  300. PLAYER_HOLD[v.Name .. i].diff = DIFF
  301. table.insert(DISTANCES, DIFF)
  302. end
  303. end
  304. end
  305.  
  306. if unpack(DISTANCES) == nil then
  307. return false
  308. end
  309.  
  310. local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  311. if L_DISTANCE > 20 then
  312. return false
  313. end
  314.  
  315. for i, v in pairs(PLAYER_HOLD) do
  316. if v.diff == L_DISTANCE then
  317. return v.plr
  318. end
  319. end
  320. return false
  321. end
  322.  
  323. GUI_MAIN = Instance.new('ScreenGui', game.CoreGui)
  324. GUI_TARGET = Instance.new('TextLabel', GUI_MAIN)
  325. GUI_AIM_AT = Instance.new('TextLabel', GUI_MAIN)
  326.  
  327. GUI_MAIN.Name = 'AIMBOT'
  328.  
  329. GUI_TARGET.Size = UDim2.new(0,200,0,30)
  330. GUI_TARGET.BackgroundTransparency = 0.5
  331. GUI_TARGET.BackgroundColor = BrickColor.new('Fossil')
  332. GUI_TARGET.BorderSizePixel = 0
  333. GUI_TARGET.Position = UDim2.new(0.5,-100,0,0)
  334. GUI_TARGET.Text = 'AIMBOT : OFF'
  335. GUI_TARGET.TextColor3 = Color3.new(1,1,1)
  336. GUI_TARGET.TextStrokeTransparency = 1
  337. GUI_TARGET.TextWrapped = true
  338. GUI_TARGET.FontSize = 'Size24'
  339. GUI_TARGET.Font = 'SourceSansBold'
  340.  
  341. GUI_AIM_AT.Size = UDim2.new(0,200,0,20)
  342. GUI_AIM_AT.BackgroundTransparency = 0.5
  343. GUI_AIM_AT.BackgroundColor = BrickColor.new('Fossil')
  344. GUI_AIM_AT.BorderSizePixel = 0
  345. GUI_AIM_AT.Position = UDim2.new(0.5,-100,0,30)
  346. GUI_AIM_AT.Text = 'AIMING : HEAD'
  347. GUI_AIM_AT.TextColor3 = Color3.new(1,1,1)
  348. GUI_AIM_AT.TextStrokeTransparency = 1
  349. GUI_AIM_AT.TextWrapped = true
  350. GUI_AIM_AT.FontSize = 'Size18'
  351. GUI_AIM_AT.Font = 'SourceSansBold'
  352.  
  353. local TRACK = false
  354.  
  355. function CREATE(BASE, TEAM)
  356. local ESP_MAIN = Instance.new('BillboardGui', PLAYER.PlayerGui)
  357. local ESP_DOT = Instance.new('Frame', ESP_MAIN)
  358. local ESP_NAME = Instance.new('TextLabel', ESP_MAIN)
  359.  
  360. ESP_MAIN.Name = 'ESP'
  361. ESP_MAIN.Adornee = BASE
  362. ESP_MAIN.AlwaysOnTop = true
  363. ESP_MAIN.ExtentsOffset = Vector3.new(0, 1, 0)
  364. ESP_MAIN.Size = UDim2.new(0, 5, 0, 5)
  365.  
  366. ESP_DOT.Name = 'DOT'
  367. ESP_DOT.BackgroundColor = BrickColor.new('Bright red')
  368. ESP_DOT.BackgroundTransparency = 0.3
  369. ESP_DOT.BorderSizePixel = 0
  370. ESP_DOT.Position = UDim2.new(-0.5, 0, -0.5, 0)
  371. ESP_DOT.Size = UDim2.new(2, 0, 2, 0)
  372. ESP_DOT.Visible = true
  373. ESP_DOT.ZIndex = 10
  374.  
  375. ESP_NAME.Name = 'NAME'
  376. ESP_NAME.BackgroundColor3 = Color3.new(255, 255, 255)
  377. ESP_NAME.BackgroundTransparency = 1
  378. ESP_NAME.BorderSizePixel = 0
  379. ESP_NAME.Position = UDim2.new(0, 0, 0, -40)
  380. ESP_NAME.Size = UDim2.new(1, 0, 10, 0)
  381. ESP_NAME.Visible = true
  382. ESP_NAME.ZIndex = 10
  383. ESP_NAME.Font = 'ArialBold'
  384. ESP_NAME.FontSize = 'Size14'
  385. ESP_NAME.Text = BASE.Parent.Name:upper()
  386. ESP_NAME.TextColor = BrickColor.new('Bright red')
  387. end
  388.  
  389. function CLEAR()
  390. for _,v in pairs(PLAYER.PlayerGui:children()) do
  391. if v.Name == 'ESP' and v:IsA('BillboardGui') then
  392. v:Destroy()
  393. end
  394. end
  395. end
  396.  
  397. function FIND()
  398. CLEAR()
  399. TRACK = true
  400. spawn(function()
  401. while wait() do
  402. if TRACK then
  403. CLEAR()
  404. for i,v in pairs(game.Players:GetChildren()) do
  405. if v.Character and v.Character:FindFirstChild('Head') then
  406. if _G.FREE_FOR_ALL == false then
  407. if v.TeamColor ~= PLAYER.TeamColor then
  408. if v.Character:FindFirstChild('Head') then
  409. CREATE(v.Character.Head, true)
  410. end
  411. end
  412. else
  413. if v.Character:FindFirstChild('Head') then
  414. CREATE(v.Character.Head, true)
  415. end
  416. end
  417. end
  418. end
  419. end
  420. end
  421. wait(1)
  422. end)
  423. end
  424.  
  425. MOUSE.KeyDown:connect(function(KEY)
  426. KEY = KEY:lower():byte()
  427. if KEY == _G.BIND then
  428. ENABLED = true
  429. end
  430. end)
  431.  
  432. MOUSE.KeyUp:connect(function(KEY)
  433. KEY = KEY:lower():byte()
  434. if KEY == _G.BIND then
  435. ENABLED = false
  436. end
  437. end)
  438.  
  439. MOUSE.KeyDown:connect(function(KEY)
  440. KEY = KEY:lower():byte()
  441. if KEY == _G.ESP_BIND then
  442. if ESP_ENABLED == false then
  443. FIND()
  444. ESP_ENABLED = true
  445. print('ESP : ON')
  446. elseif ESP_ENABLED == true then
  447. wait()
  448. CLEAR()
  449. TRACK = false
  450. ESP_ENABLED = true
  451. print('ESP : OFF')
  452. end
  453. end
  454. end)
  455.  
  456. MOUSE.KeyDown:connect(function(KEY)
  457. if KEY == _G.CHANGE_AIM then
  458. if _G.AIM_AT == 'Head' then
  459. _G.AIM_AT = 'Torso'
  460. GUI_AIM_AT.Text = 'AIMING : TORSO'
  461. elseif _G.AIM_AT == 'Torso' then
  462. _G.AIM_AT = 'Head'
  463. GUI_AIM_AT.Text = 'AIMING : HEAD'
  464. end
  465. end
  466. end)
  467.  
  468. game:GetService('RunService').RenderStepped:connect(function()
  469. if ENABLED then
  470. local TARGET = GetNearestPlayerToMouse()
  471. if (TARGET ~= false) then
  472. local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
  473. if AIM then
  474. CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
  475. end
  476. GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
  477. else
  478. GUI_TARGET.Text = 'AIMBOT : OFF'
  479. end
  480. end
  481. end)
  482.  
  483. repeat
  484. wait()
  485. if ESP_ENABLED == true then
  486. FIND()
  487. end
  488. until ESP_ENABLED == false
  489. wait()
  490. _G.FREE_FOR_ALL = true
  491. _G.BIND = 50 -- LEFT CTRL
  492. _G.ESP_BIND = 52 -- LEFT ALT
Add Comment
Please, Sign In to add comment