Advertisement
Shrektella

Untitled

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