Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. local accuracy = 80
  4. local aimkey = "f"
  5. local toggle_teamcheck = "h" --Ez-Pz Fix so people don't have to rejoin on FFA/TDM Games.
  6. local headshot = 35
  7. local ignoreFOV = true
  8. local ignoreWalls = true
  9. local perfect_aim = true
  10. local perfect_aim_firstperson_distance = 28
  11. local rage_triggers = false --Elysian Only
  12. local RenderLassos = true
  13. local ShootingTeam = false -- will target neutral people anyways XDDD
  14. local SpreadControlRadius = Vector3.new(25, 25, 15) -- 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
  15. local trigger_speed = 0.1
  16. local triggers = false --Elysian Only
  17. local Chams = false --Buggy
  18.  
  19. --Player Whitelist(People who don't get shot at.)
  20. local Whitelist = {"ihanks", "Lua_Environment", "like_clockwork", "Gin_Freecs", "AimWorks"}
  21. for i,v in pairs(game.Players:GetChildren()) do --Adds anyone in-game who's friends with the Currenet player into the list.
  22. if game.Players.LocalPlayer:IsFriendsWith(v.userId) then
  23. table.insert(Whitelist, v.Name)
  24. end
  25. end
  26.  
  27. game.Players.PlayerAdded:connect(function(player) --Adds friends to whitelist if they're just joining the game.
  28. if game.Players.LocalPlayer:IsFriendsWith(player.userId) then
  29. table.insert(Whitelist, player.Name)
  30. end
  31. end)
  32.  
  33. -- todo --
  34. _G.SwordFightMode = false -- stuff that i am testing goes in _G. so i can toggle it
  35.  
  36. -- aim engine vars
  37. -- todo: more priorities
  38. -- prune dead vars
  39. local aim_through_list = {nil, nil, nil}
  40. local bone_name
  41. local camera = workspace.CurrentCamera
  42. local closest_distance
  43. local deathBlock
  44. local distance
  45. local FilteringEnabled = workspace.FilteringEnabled
  46. local huge = math.huge
  47. local in_fov
  48. local lasso
  49. local localplayer = game:GetService("Players").LocalPlayer
  50. local most_viable_player
  51. local mouse = localplayer:GetMouse()
  52. local CreatorId = game.CreatorId
  53. local players_service = game:GetService("Players")
  54. local position
  55. local random = math.random
  56. local ray = Ray.new
  57. local ray_start
  58. local running = true
  59. local sleeping
  60. local target
  61. local tele_bone
  62. local targ_bone
  63. local ticksslept = 0
  64. local trigger_debounce
  65. local vector
  66. local viableplayers = {}
  67.  
  68. 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
  69.  
  70. if not search_directory then return end
  71.  
  72. for i, v in pairs(search_directory:GetChildren()) do
  73. if v.className == instance_className then
  74. return(v)
  75. end
  76. end
  77.  
  78. end
  79.  
  80. local function CreateBlockOfDeath()
  81.  
  82. if deathBlock then deathBlock:Destroy() end
  83.  
  84. deathBlock = Instance.new("Part", workspace)
  85. deathBlock.CanCollide = false
  86. deathBlock.Size = SpreadControlRadius
  87. deathBlock.Locked = true
  88. mouse.TargetFilter = deathBlock
  89. return deathBlock -- unnecessary
  90.  
  91. end -- Finished
  92.  
  93. local function ReturnsScreenCoordinatesAsVectorAndFOVChecksAsBool(player, bone) -- note: figure out what i wanted to do with datas in here
  94.  
  95. if not bone then
  96. return {_, false}
  97. end
  98.  
  99. return camera:WorldToScreenPoint(player.Character[bone].Position)
  100.  
  101. end
  102.  
  103. local function ReturnsPlayerCheckResults(player)
  104.  
  105. -- 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.
  106. if not ShootingTeam then -- if not shooting teammates
  107. if player.TeamColor == localplayer.TeamColor then -- if we're not shooting teammates and they're teammates
  108. if not (player.Neutral and localplayer.Neutral) then -- if we're not shooting teammates and they're teammates and they're not neutral
  109. return false
  110. end
  111. end
  112. end
  113.  
  114. --Read through player 'Whitelist'
  115. for i,v in pairs(Whitelist) do
  116. if player.Name == v then
  117. return false
  118. end
  119. end
  120.  
  121. -- Checks if person is yourself.
  122. if player == localplayer then
  123. return false
  124. end
  125.  
  126. -- Checks if the player can be hurt.
  127. if FindInstance("ForceField", player.Character) or FindInstance("Humanoid", player.Character, true).MaxHealth == huge then
  128. return false
  129. end
  130.  
  131. -- Checks if they're dead.
  132. if FindInstance("Humanoid", player.Character, true).Health == 0 then
  133. return false
  134. end
  135.  
  136. -- Checks if person is in FOV.
  137. local screen_position, in_fov = ReturnsScreenCoordinatesAsVectorAndFOVChecksAsBool(player, "Torso")
  138. if not (in_fov or ignoreFOV) then
  139. return false
  140. else
  141. return player, screen_position
  142. end
  143.  
  144. end
  145.  
  146. local function ReturnsBoneOrFalse(player)
  147.  
  148. if perfect_aim then
  149. return (FilteringEnabled and "Head" or "Left Arm") -- should be Head or left arm
  150. end
  151.  
  152. if not (random(1, 100) <= accuracy) then
  153. return false
  154. end
  155.  
  156. if (random(1, 100) <= headshot) and FilteringEnabled then
  157. return "Head"
  158. end
  159.  
  160. return "Left Arm" -- should be left arm
  161.  
  162. end
  163.  
  164.  
  165. -- rewrite for cursor distance checks then optimize
  166. local function ReturnsViablePlayerOrNil() -- this is a clusterfuck i should probably branch this off into more functions... especially one for raycasting
  167. aim_through_list[1], aim_through_list[2] = deathBlock, localplayer.Character
  168. local distance = 1000
  169. local closest_distance = 1000
  170. local most_viable_player = nil
  171.  
  172. -- FPS optimizations for shitty pcs... should more than double FPS in some situations. not really necessary for me :D..
  173. -- if sleeping and ticksslept ~= 15 then
  174. -- ticksslept = ticksslept + 1
  175. -- return target
  176. -- end
  177.  
  178. local your_character = localplayer.Character
  179. local your_head = your_character and your_character:FindFirstChild "Head"
  180.  
  181. for i, player_being_checked in pairs(players_service:GetPlayers()) do -- getplayers is underrated
  182.  
  183. local player_or_false, targets_coordinates = ReturnsPlayerCheckResults(player_being_checked)
  184.  
  185. if player_or_false then
  186.  
  187. local char = player_being_checked.Character
  188. local target_torso = char and char:FindFirstChild "Torso" -- where the ray will aim/shoot for
  189.  
  190. if target_torso then
  191.  
  192. -- phantom fuckery tbh
  193. -- aim ahead (why arent we just taking advantage of ignorerays austin tf) of gun sights... Swag :O
  194. if (camera.Focus.p - camera.CoordinateFrame.p).magnitude <= 1 then
  195. ray_start = your_head.Position + your_head.CFrame.lookVector * 10 + Vector3.new(0, 3, 0)
  196. else
  197. ray_start = your_head.Position + Vector3.new(0, 2, 0)
  198. end
  199.  
  200. -- ray_start = your_head.Position + your_head.CFrame.lookVector * 10 + Vector3.new(0, 3, 0) -- doododoo do DOODODOododoDoERFAhaagr
  201.  
  202. if not targets_coordinates then -- unnecessary rn
  203. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude -- broken
  204. else
  205. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  206. end
  207. vector = (target_torso.Position - ray_start)
  208.  
  209. -- distance = vector -- bug
  210.  
  211. if (not targets_coordinates) or (distance <= closest_distance) then
  212.  
  213. -- create ray that starts at 'ray_start' and points towards the target
  214. local new_ray = ray(ray_start, vector.unit * 1000) -- "fire" ray and make sure to ignore our own character
  215. 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
  216.  
  217. if (hit and hit:isDescendantOf(char)) or ignoreWalls then
  218. -- only change closest_distance if the target character is visible
  219. closest_distance = distance
  220. most_viable_player = player_being_checked
  221. end -- hit or ignore walls
  222.  
  223. end -- meets distance or no priority
  224.  
  225. end -- closes player_or_false
  226.  
  227. end -- closes player_or_false check
  228. end -- closes table loop
  229.  
  230. blockName = ReturnsBoneOrFalse(most_viable_player)
  231. sleeping = true
  232. return most_viable_player
  233.  
  234. end -- closes function
  235.  
  236.  
  237. function CreateChams()
  238. if Chams then
  239. for i,v in pairs(camera:GetChildren()) do
  240. v:Destroy()
  241. end
  242. for q,player in pairs(game.Players:GetPlayers()) do
  243. if player.Character.Head:FindFirstChild("face") then
  244. player.Character.Head.face:Destroy()
  245. end
  246. if player.Character.Head:FindFirstChild("BoxHandleAdornment") then
  247. local ESP = false
  248. else
  249. if player.Name ~= localplayer.Name then
  250. for i,v in pairs(player.Character:GetChildren()) do
  251. if v:IsA("BasePart") then
  252. if v.Name ~= "Head" then
  253. local fakeChams = Instance.new("BoxHandleAdornment", v)
  254. local esp = Instance.new("BoxHandleAdornment", camera)
  255. for c,w in pairs(Whitelist) do
  256. if player.Name == w then
  257. esp.Color3 = Color3.new(0,0,255)
  258. esp.Adornee = v
  259. esp.AlwaysOnTop = true
  260. else
  261. if player.TeamColor == localplayer.TeamColor then
  262. esp.Color3 = Color3.new(0,255,0)
  263. esp.Adornee = v
  264. esp.AlwaysOnTop = true
  265. else
  266. if player.TeamColor ~= localplayer.TeamColor then
  267. esp.Color3 = Color3.new(255,0,0)
  268. esp.Adornee = v
  269. esp.AlwaysOnTop = true
  270. end
  271. end
  272. end
  273. end
  274. end
  275. end
  276. end
  277. end
  278. end
  279. end
  280. end
  281. end
  282.  
  283. CreateChams()
  284.  
  285. game.Workspace.ChildAdded:connect(function(child)
  286. if child:IsA("Model") or child:IsA("Folder") then
  287. CreateChams()
  288. end
  289. end)
  290.  
  291. game.Workspace.ChildRemoved:connect(function(child)
  292. if child:IsA("Model") or child:IsA("Folder") then
  293. CreateChams()
  294. end
  295. end)
  296.  
  297. game.Players.LocalPlayer.Changed:connect(function()
  298. CreateChams()
  299. end)
  300.  
  301. local function TargetPlayer(player) -- this needs to be refactored
  302.  
  303. -- not needed anymore unless you want sticky aim (this can be a good thing) or the aimbot lags you
  304. -- sticky aim would be defined as "wont instantly target another guy if they enter the screen"
  305.  
  306. -- if ticksslept == 15 then -- ok
  307. -- ticksslept = 0
  308. -- sleeping = false
  309. -- end
  310.  
  311. if aim_through_list[3] then
  312. aim_through_list[3].Position = aim_through_list[3].Position + Vector3.new(0,200,0)
  313. table.remove(aim_through_list, 3)
  314. end
  315.  
  316. if not player then -- i see this and i pretty much give up on rewriting
  317. if lasso then lasso:Destroy() lasso = nil end -- this feels wrong. i cant stand reusing code outside functions >:(
  318. target = nil
  319. lasso = Instance.new("SelectionPointLasso", camera)
  320. lasso.Humanoid, lasso.Point = FindInstance("Humanoid", localplayer.Character, true), mouse.Hit.p
  321. lasso.Color3 = Color3.new(0,255,0)
  322. return -- this one line here determines a surprising amount about how the aimbot works XD
  323. -- thats not a good thing :(
  324. end
  325.  
  326. if RenderLassos then -- should be snaplassos... always gon be lassos tbh
  327. if lasso then lasso:Destroy() lasso = nil end
  328. lasso = Instance.new("SelectionPartLasso", camera)
  329. lasso.Humanoid, lasso.Part = FindInstance("Humanoid", player.Character, true), game.Players.LocalPlayer.Character.Torso
  330. lasso.Color3 = Color3.new(0,255,0)
  331. end
  332.  
  333. bone_name = ReturnsBoneOrFalse(player)
  334.  
  335. if player.Character.Head and bone_name then
  336. -- this lets us force headshots :D
  337. tele_bone = player.Character[bone_name]
  338. tele_bone.Parent = player.Character
  339. tele_bone.Size = SpreadControlRadius
  340. tele_bone.CanCollide = false
  341. 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,,,, for this and for showing me the magic of coordinateframe <3
  342. tele_bone.Transparency=1
  343. tele_bone:ClearAllChildren()
  344. table.insert(aim_through_list, 3, tele_bone)
  345. -- swager
  346. target = player
  347. return player
  348.  
  349. end
  350.  
  351. if bone_name then
  352. deathBlock.Parent = player.Character
  353. deathBlock.CanCollide = false
  354. deathBlock.Name = bone_name
  355. else
  356. return
  357. end
  358.  
  359. target = player
  360. return player
  361.  
  362. end
  363.  
  364.  
  365. --[[
  366.  
  367. INIT PROCESS DOCUMENTATION:
  368.  
  369. 1] CREATE DEATHBLOCK
  370. 2] MAKE DEATHBLOCK REGENERATE
  371. 3] USE BINDTORENDERSTEP TO START AIMBOT LOOP
  372. 4] DETECT KEY INPUT (WITHOUT USERINPUTSERVICE. I KNOW THAT IM LAME)
  373.  
  374. ]]--
  375.  
  376.  
  377. CreateBlockOfDeath()
  378. workspace.DescendantRemoving:connect(function(instance)
  379. if instance == deathBlock then CreateBlockOfDeath() end
  380. end)
  381. -- Keeps blockie safe :33 XD
  382.  
  383. -- test? havent tried
  384. local function shoot() -- elysian only :33333 XDd. bother jordan, not mememememe.
  385.  
  386. if not mouse1press then return end
  387.  
  388. if trigger_debounce then return end
  389.  
  390. trigger_debounce = true
  391.  
  392. if rage_triggers and mouse1press() then
  393.  
  394. mouse1press()
  395. wait(0.1)
  396. mouse1release()
  397.  
  398. elseif mouse1press then
  399.  
  400. mouse1press()
  401. wait(0)
  402. mouse1release()
  403. wait(trigger_speed)
  404.  
  405. end
  406.  
  407. trigger_debounce = false
  408.  
  409. end
  410.  
  411. -- refaactorrrr
  412. game:GetService("RunService"):BindToRenderStep("First", Enum.RenderPriority.First.Value, function() -- another clusterfuck
  413.  
  414. if running then
  415. if localplayer.Character then -- pretty sure i do this in getviableplayer lmao tbh
  416. TargetPlayer(ReturnsViablePlayerOrNil())
  417. if target and target.Character then
  418. if localplayer:GetMouse().Target == deathBlock then return end -- praise targetfilter!
  419. -- later
  420. -- deathBlock.CFrame = CFrame.new(localplayer.Character.Head.Position + (mouse.Hit.p + localplayer.Character.Head.Position).unit * 16)
  421. -- print(deathBlock)
  422. if triggers then shoot() end
  423. else
  424. deathBlock.Parent = workspace
  425. end
  426. end
  427. end
  428.  
  429. end)
  430.  
  431. local keydown = mouse.KeyDown:connect(function(keys)
  432. if (keys == aimkey) then
  433. running = not running
  434. if (running) then
  435. print("[SILENTAIM] activated.")
  436. else
  437. print("[SILENTAIM] deactivated.")
  438. end
  439. end
  440. end)
  441.  
  442. local keydowns = mouse.KeyDown:connect(function(keys)
  443. if (keys == toggle_teamcheck) then
  444. if (ShootingTeam) then
  445. print("[SILENTAIM] Team Shooting deactivated")
  446. ShootingTeam = false
  447. else
  448. print("[SILENTAIM] Team Shooting activated")
  449. ShootingTeam = true
  450. end
  451. end
  452. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement