Advertisement
sweatband

lv hitbox

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