Advertisement
Guest User

Aimbot script

a guest
Apr 26th, 2017
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.21 KB | None | 0 0
  1. -- /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$
  2. -- /$$__ $$|_ $$_/| $$$ /$$$| $$ /$ | $$ /$$__ $$| $$__ $$| $$ /$$/ /$$__ $$ /$$__ $$ /$$$$
  3. -- | $$ \ $$ | $$ | $$$$ /$$$$| $$ /$$$| $$| $$ \ $$| $$ \ $$| $$ /$$/ | $$ \__/ |__/ \ $$ |_ $$
  4. -- | $$$$$$$$ | $$ | $$ $$/$$ $$| $$/$$ $$ $$| $$ | $$| $$$$$$$/| $$$$$/ | $$$$$$ /$$$$$/ | $$
  5. -- | $$__ $$ | $$ | $$ $$$| $$| $$$$_ $$$$| $$ | $$| $$__ $$| $$ $$ \____ $$ |___ $$ | $$
  6. -- | $$ | $$ | $$ | $$\ $ | $$| $$$/ \ $$$| $$ | $$| $$ \ $$| $$\ $$ /$$ \ $$ /$$ \ $$ | $$
  7. -- | $$ | $$ /$$$$$$| $$ \/ | $$| $$/ \ $$| $$$$$$/| $$ | $$| $$ \ $$| $$$$$$/ | $$$$$$//$$ /$$$$$$
  8. -- |__/ |__/|______/|__/ |__/|__/ \__/ \______/ |__/ |__/|__/ \__/ \______/ \______/|__/|______/
  9. -- LAWN KEVIN DID IT ALL I SWEAR
  10.  
  11.  
  12. -- AIMWORKS 7: MOWS THE LAWN NOW
  13. -- THE HOTTEST NEW BOT ON ROBLOX
  14. -- AND PROBABLY THE BUGGIEST TOO
  15. -- BUT WHATEVER IT'S GOOD ENOUGH
  16. -- WRITTEN BY UNREAL AND FRIENDS
  17. -- THANKS AUSTIN, CACA22, SAFAZI
  18. -- THX 2 THETRUERIAS 4 BUG FIXES
  19. -- SHOUTOUT TO CHROME/XETRICS XD
  20.  
  21. -- i should probably be using userinputservice
  22. -- combine closestplayer and ray checks using :Distance and distance-1
  23. -- move lasso to mouse cursor position
  24. -- better
  25. -- prune dead vars
  26. -- shit these comments are like a million years old most of these arent even relevant anymore wtf
  27. -- new comment that isnt rly old: REWRITE EVEERRYTHNing
  28. -- update to that: neoworks tbh
  29.  
  30. local accuracy = 99 -- percent accuracy in general.
  31. local aimkey = "f"
  32. local headshot = 99 -- percent accuracy of headshots in FILTERINGENABLED GAMES. only FE games are affected by this number . this percentage, if the aimbot dis accurate enough, is the percent chance that the aimbot will want to favor a headshot
  33. local ignoreFOV = true -- you can have it shoot through walls, target people you cant see, etc., using settings here.
  34. local FOV = 0.25 -- -1 to disable. decides radius size
  35. local ignoreWalls = false
  36. local perfect_aim = true -- you might want this to be false if you dont want to look really shady
  37. local perfect_aim_firstperson_distance = 30
  38. local pf_automatic_triggers = true
  39. local RenderLassos = true
  40. local ShootingTeam = false -- will target neutral people anyways XDDD
  41. local SpreadControlRadius = Vector3.new(30, 30, 30) -- the larger you make those numbers the more likely your bullet is to hit. anything above 25, 25, 25 is a bit much. try 15, 15, 5
  42. local trigger_speed = 0.1
  43. local triggers = true
  44. local forceheadshotsyolo = false
  45.  
  46. _G.debugaimworks = function(string_args) loadstring(string_args)() end
  47.  
  48. -- todo --
  49. _G.SwordFightMode = false -- stuff that i am testing goes in _G. so i can toggle it
  50.  
  51. -- aim engine vars
  52. -- todo: more priorities
  53. -- prune dead vars
  54. local aim_through_list = {nil, nil, nil}
  55. local bone_name
  56. local camera = workspace.CurrentCamera
  57. local closest_distance
  58. local deathBlock
  59. local distance
  60. local distance2
  61. local FilteringEnabled = workspace.FilteringEnabled
  62. local huge = math.huge
  63. local in_fov
  64. local lasso
  65. local localplayer = game:GetService("Players").LocalPlayer
  66. local most_viable_player
  67. local mouse = localplayer:GetMouse()
  68. local CreatorId = game.CreatorId
  69. local placeid = game.PlaceId
  70. local players_service = game:GetService("Players")
  71. local position
  72. local random = math.random
  73. local ray = Ray.new
  74. local ray_start
  75. local running = true
  76. local sleeping
  77. local target
  78. local tele_bone
  79. local targ_bone
  80. local ticksslept = 0
  81. local trigger_debounce
  82. local triggering = false
  83. local vector
  84. local viableplayers = {}
  85. local distanceninemillion
  86. local friends = {"safazi", "rektec", "alusionteam"}
  87.  
  88. local ScreenX, ScreenY = workspace.CurrentCamera.ViewportSize.X, workspace.CurrentCamera.ViewportSize.Y
  89. local inversePi = 1 / math.pi
  90. local magic = FOV*inversePi
  91.  
  92. Pixels = ScreenX * ScreenY
  93.  
  94. Radius = math.sqrt(Pixels*magic)
  95.  
  96. print(Radius)
  97.  
  98. -- if game.PlaceId == 302436427 then -- anarchy
  99. -- ShootingTeam = true
  100. -- triggers = false
  101. -- end
  102.  
  103. local getGroupFromName=function(name)
  104. if(not game.Lighting:FindFirstChild'Groups')then return;end;
  105. for i,v in pairs(game.Lighting.Groups:children'')do
  106. for o,b in pairs(v:children'')do
  107. if(b.Value==name)then
  108. return v;
  109. end;
  110. end;
  111. end;
  112. end;
  113.  
  114. local function FindInstance(instance_className, search_directory) -- i can inline this in a LOT of places... plus i can very very easily make this return a table of all found parts if a certain parameter is passed... might add that feature to my boilerplate
  115.  
  116. if not search_directory then return end
  117.  
  118. for i, v in pairs(search_directory:GetChildren()) do
  119. if v.className == instance_className then
  120. return(v)
  121. end
  122. end
  123.  
  124. end
  125.  
  126. local function CreateBlockOfDeath()
  127.  
  128. if deathBlock then deathBlock:Destroy() end
  129.  
  130. deathBlock = Instance.new("Part", workspace)
  131. deathBlock.Anchored = true
  132. deathBlock.CanCollide = false
  133. deathBlock.Transparency = 1
  134. deathBlock.Size = SpreadControlRadius
  135. deathBlock.Locked = true
  136. mouse.TargetFilter = deathBlock
  137. return deathBlock -- unnecessary
  138.  
  139. end -- Finished
  140.  
  141. local function ReturnsScreenCoordinatesAsVectorAndFOVChecksAsBool(player, bone) -- note: figure out what i wanted to do with datas in here
  142.  
  143. if not bone then
  144. return {_, false}
  145. end
  146.  
  147. return camera:WorldToScreenPoint(player.Character[bone].Position)
  148.  
  149. end
  150.  
  151. local function ReturnsPlayerCheckResults(player)
  152.  
  153. -- Checks teams. If we won't shoot teammates and they're a teammate when we're not neutral, target them. We do this now because it can save a lot of FPS.
  154. if not ShootingTeam then -- if not shooting teammates
  155. if player.TeamColor == localplayer.TeamColor then -- if we're not shooting teammates and they're teammates
  156. if not (player.Neutral and localplayer.Neutral) then -- if we're not shooting teammates and they're teammates and they're not neutral
  157. return false
  158. end
  159. end
  160. end
  161.  
  162.  
  163. if not localplayer.Character then return false end -- what the fuck why do i need these wqtfwtf is going on AaaaAAAAA a a
  164. if not localplayer.Character:FindFirstChild'Head' then return false end ---wtf?????
  165. if not player.Character then return false end -- so it turns out roblox studio seems to have what i think is a bug where even if you don't have a character, you still have a character. nice
  166.  
  167. distanceninemillion = player:DistanceFromCharacter(localplayer.Character.Head.Position)
  168. if distanceninemillion <= 3 or distanceninemillion > 1000 then return false end
  169.  
  170.  
  171. -- ok back to normal
  172.  
  173.  
  174. -- Checks if the player can be hurt.
  175. if FindInstance("ForceField", player.Character) then
  176. return false
  177. end
  178.  
  179. -- Checks if they're dead.
  180. -- if FindInstance("Humanoid", player.Character, true).Health == 0 then
  181. -- return false
  182. -- end
  183.  
  184. -- print(player.Character.Humanoid.Health)
  185. if player.Character.Humanoid.Health == 0 then return false end
  186.  
  187. if friends[player.Name] then return false end
  188.  
  189. if game.Lighting:FindFirstChild'Groups' then
  190. if getGroupFromName(player.Name) == getGroupFromName(localplayer.Name) then return false end
  191. end
  192.  
  193. -- Checks if person is in FOV.
  194. local screen_position, in_fov = ReturnsScreenCoordinatesAsVectorAndFOVChecksAsBool(player, "Torso") -- end my life
  195. if not (in_fov or ignoreFOV) then
  196. return false
  197. else -- there's a bug somewhere here with fov checks and i want to end my life. it works in roblox studio too but not in online
  198. if (not ignoreFOV) and (FOV~=-1) then
  199. distance2 = (Vector2.new(screen_position.X, screen_position.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  200. if distance2<=Radius then
  201. -- print(distance2)
  202. return player, screen_position
  203. end
  204. -- print(distance2)
  205. return false
  206. else
  207. return player, screen_position
  208. end
  209. end
  210.  
  211.  
  212. end
  213.  
  214. local function ReturnsBoneOrFalse(player)
  215.  
  216. if perfect_aim then
  217. return (FilteringEnabled and "Head" or "Left Arm") -- should be Head or
  218. end
  219.  
  220. if not (random(1, 100) <= accuracy) then
  221. return false
  222. end
  223.  
  224. if (random(1, 100) <= headshot) and FilteringEnabled then
  225. return "Head"
  226. end
  227.  
  228. return "Left Arm" -- should be left arm
  229.  
  230. end
  231.  
  232.  
  233. -- rewrite for cursor distance checks then optimize
  234. local function ReturnsViablePlayerOrNil() -- fun fact: this isnt even the worst part of the script
  235. -- i blame austin _entirely_
  236. aim_through_list[1], aim_through_list[2] = deathBlock, localplayer.Character
  237. local distance = 1000
  238. local closest_distance = 1000
  239. local most_viable_player = nil
  240.  
  241. -- FPS optimizations for shitty pcs... should more than double FPS in some situations. not really necessary for me :D..
  242. -- if sleeping and ticksslept ~= 15 then
  243. -- ticksslept = ticksslept + 1
  244. -- return target
  245. -- end
  246.  
  247. local your_character = localplayer.Character
  248. local your_head = your_character and your_character:FindFirstChild "Head"
  249.  
  250. for i, player_being_checked in pairs(players_service:GetPlayers()) do -- getplayers is underrated
  251.  
  252. local player_or_false, targets_coordinates = ReturnsPlayerCheckResults(player_being_checked)
  253.  
  254. if player_or_false then
  255.  
  256. local char = player_being_checked.Character
  257. local target_torso = char and char:FindFirstChild "Torso" -- where the ray will aim/shoot for
  258.  
  259. if target_torso then
  260.  
  261. -- phantom fuckery tbh
  262. -- aim ahead (why arent we just taking advantage of ignorerays austin tf) of gun sights... Swag :O
  263. if (camera.Focus.p - camera.CoordinateFrame.p).magnitude <= 1 then
  264. ray_start = your_head.Position + your_head.CFrame.lookVector * 16 + Vector3.new(0, 4, 0)
  265. else
  266. ray_start = your_head.Position + Vector3.new(0, 4, 0)
  267. -- ray_start = your_head.Position + your_head.CFrame.lookVector * 10 + Vector3.new(0, 3, 0)
  268. end
  269.  
  270. -- ray_start = your_head.Position + your_head.CFrame.lookVector * 10 + Vector3.new(0, 3, 0) -- doododoo do DOODODOododoDoERFAhaagr
  271.  
  272. if not targets_coordinates then -- unnecessary rn
  273. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude -- broken
  274. else
  275. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  276. end
  277. vector = (target_torso.Position - ray_start)
  278.  
  279. -- distance = vector -- bug
  280.  
  281. if (not targets_coordinates) or (distance <= closest_distance) then
  282.  
  283. -- create ray that starts at 'ray_start' and points towards the target
  284. local new_ray = ray(ray_start, vector.unit * 1000) -- "fire" ray and make sure to ignore our own character
  285. local hit, position = workspace:FindPartOnRayWithIgnoreList(new_ray, aim_through_list) -- check if the ray hit anything and if it's a descendant of the target's character
  286.  
  287. if (hit and hit:isDescendantOf(char)) or ignoreWalls then
  288. -- only change closest_distance if the target character is visible
  289. closest_distance = distance
  290. most_viable_player = player_being_checked
  291. end -- hit or ignore walls
  292.  
  293. end -- meets distance or no priority
  294.  
  295. end -- closes player_or_false
  296.  
  297. end -- closes player_or_false check
  298. end -- closes table loop
  299.  
  300. deathBlock.Name = tostring(ReturnsBoneOrFalse(most_viable_player))
  301. sleeping = true
  302. return most_viable_player
  303.  
  304. end -- closes function
  305.  
  306. local function TargetPlayer(player) -- this needs to be refactored
  307.  
  308. -- not needed anymore unless you want sticky aim (this can be a good thing) or the aimbot lags you
  309. -- sticky aim would be defined as "wont instantly target another guy if they enter the screen"
  310.  
  311. -- if ticksslept == 15 then -- ok
  312. -- ticksslept = 0
  313. -- sleeping = false
  314. -- end
  315.  
  316. if aim_through_list[3] then
  317. aim_through_list[3].Position = aim_through_list[3].Position + Vector3.new(0,200,0)
  318. table.remove(aim_through_list, 3)
  319. end
  320.  
  321. if not player then -- i see this and i pretty much give up on rewriting
  322. if lasso then lasso:Destroy() lasso = nil end -- this feels wrong. i cant stand reusing code outside functions >:(
  323. target = nil
  324. if RenderLassos then
  325. lasso = Instance.new("SelectionPointLasso", camera)
  326. lasso.Humanoid, lasso.Point = FindInstance("Humanoid", localplayer.Character, true), mouse.Hit.p
  327. lasso.Color = BrickColor.new(1, 1, 0)
  328. end
  329. return -- this one line here determines a surprising amount about how the aimbot works XD
  330. -- thats not a good thing :(
  331. end
  332.  
  333. if RenderLassos then -- should be snaplassos... always gon be lassos tbh
  334. if lasso then lasso:Destroy() lasso = nil end
  335. lasso = Instance.new("SelectionPartLasso", camera)
  336. lasso.Humanoid, lasso.Part = FindInstance("Humanoid", player.Character, true), game.Players.LocalPlayer.Character.Torso
  337. lasso.Color = player.TeamColor
  338. end
  339.  
  340. bone_name = ReturnsBoneOrFalse(player)
  341.  
  342. if (CreatorId == 1103278 or placeid == 302436427 or forceheadshotsyolo) and player.Character.Head and bone_name then
  343. tele_bone = player.Character[bone_name]
  344.  
  345. tele_bone.Size = SpreadControlRadius
  346. tele_bone.CFrame = CFrame.new(workspace.CurrentCamera.CoordinateFrame.p + workspace.CurrentCamera.CoordinateFrame.lookVector * perfect_aim_firstperson_distance, workspace.CurrentCamera.CoordinateFrame.p) -- // thx to my main man safazi,,,,
  347. tele_bone.Transparency = 1
  348. tele_bone:ClearAllChildren()
  349. table.insert(aim_through_list, 3, tele_bone)
  350. target = player
  351. return player
  352. end
  353.  
  354. if bone_name then
  355. deathBlock.Parent = player.Character
  356. deathBlock.Name = bone_name
  357. else
  358. deathBlock.Parent = workspace
  359. deathBlock.Position = Vector3.new(100, 10000, 100) -- enhacncet Feature Pro wow. :O
  360. return
  361. end
  362.  
  363. target = player
  364. return player
  365.  
  366. end
  367.  
  368.  
  369. --[[
  370.  
  371. INIT PROCESS DOCUMENTATION:
  372.  
  373. 1] CREATE DEATHBLOCK
  374. 2] MAKE DEATHBLOCK REGENERATE
  375. 3] USE BINDTORENDERSTEP TO START AIMBOT LOOP
  376. 4] DETECT KEY INPUT (WITHOUT USERINPUTSERVICE. I KNOW THAT IM LAME)
  377.  
  378. ]]--
  379.  
  380.  
  381. CreateBlockOfDeath()
  382. workspace.DescendantRemoving:connect(function(instance)
  383. if instance == deathBlock then CreateBlockOfDeath() end
  384. end)
  385. -- Keeps blockie safe :33 XD
  386.  
  387. -- test? havent tried
  388. local function shoot() -- elysian only :33333 XDd. bother jordan, not mememememe.
  389.  
  390. if not mouse1press then return end
  391. -- if not getfgwindowtitle() == "ROBLOX" then return end
  392. if trigger_debounce then return end
  393.  
  394. trigger_debounce = true
  395.  
  396. if pf_automatic_triggers and mouse1press() and not triggering then
  397. triggering = true
  398. mouse1press()
  399. elseif mouse1press then
  400. mouse1press()
  401. wait(0.03)
  402. mouse1release()
  403. wait(trigger_speed)
  404. end
  405.  
  406. trigger_debounce = false
  407.  
  408. end
  409.  
  410. local function releasemouse()
  411. mouse1release()
  412. triggering=false
  413. end
  414.  
  415.  
  416. -- refaactorrrr
  417. game:GetService("RunService"):BindToRenderStep("First", Enum.RenderPriority.First.Value, function() -- another clusterfuck
  418.  
  419. if running then
  420. if localplayer.Character then -- pretty sure i do this in getviableplayer lmao tbh
  421. TargetPlayer(ReturnsViablePlayerOrNil())
  422. if target and target.Character then
  423. if localplayer:GetMouse().Target == deathBlock then return end -- praise targetfilter!
  424. -- later
  425. -- deathBlock.CFrame = CFrame.new(localplayer.Character.Head.Position + (mouse.Hit.p + localplayer.Character.Head.Position).unit * 16)
  426. if (CreatorId ~= 1103278 and game.PlaceId ~= 302436427) or not forceheadshotsyolo then -- // if not phantom forces
  427. deathBlock.CFrame = CFrame.new(mouse.Hit.p)
  428. end
  429. -- print(deathBlock)
  430. if triggers then shoot() end
  431. else
  432. deathBlock.Parent = workspace
  433. deathBlock.Position = Vector3.new(100, 10000, 100)
  434. if triggering then releasemouse() end
  435. end
  436. else
  437. deathBlock.Parent = workspace
  438. deathBlock.Position = Vector3.new(100, 10000, 100)
  439. end
  440. end
  441.  
  442. end)
  443.  
  444. local keydown = mouse.KeyDown:connect(function(keys)
  445. if (keys == aimkey) then
  446. running = not running
  447. if (running) then
  448. print("[SILENTAIM] activated.")
  449. else
  450. print("[SILENTAIM] deactivated.")
  451. end
  452. end
  453. end)
  454.  
  455.  
  456. local key = "z" -- what do you want the key to be to toggle the autoshoot
  457. -- ok let me run you through some good shit
  458.  
  459. local moistureizer = mouse.KeyDown:connect(function(k)
  460. if (k == key) then
  461. -- print("TELEPORTING TO" .. print(tostring(mouse.Hit.p)))
  462. triggers = (not triggers) -- fuck off notepad++ you're gay and ass and shit nigga Damn WOW..,. ,,
  463. -- tbh idk what im typing
  464. -- me irl
  465. end
  466. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement