Advertisement
Zwiebelle1301706

Aimblox script

May 20th, 2024
879
-1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 39.01 KB | None | 0 1
  1. --[[
  2.  
  3. ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
  4. █░░░░░░██░░░░░░█░░░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░░░░░█░░░░░░░░░░░░░░█████████████
  5. █░░▄▀░░██░░▄▀░░█░░▄▀▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█████████████
  6. █░░▄▀░░██░░▄▀░░█░░░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░█░░░░▄▀░░░░█░░░░░░▄▀░░░░░░█████████████
  7. █░░▄▀░░██░░▄▀░░███░░▄▀▄▀░░▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░███░░▄▀░░███████░░▄▀░░█████████████████
  8. █░░▄▀░░██░░▄▀░░███░░░░▄▀▄▀▄▀░░░░███░░▄▀░░░░░░▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░███░░▄▀░░███████░░▄▀░░█████████████████
  9. █░░▄▀░░██░░▄▀░░█████░░▄▀▄▀▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░███░░▄▀░░███████░░▄▀░░█████████████████
  10. █░░▄▀░░██░░▄▀░░███░░░░▄▀▄▀▄▀░░░░███░░▄▀░░░░░░░░░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░███░░▄▀░░███████░░▄▀░░█████████████████
  11. █░░▄▀▄▀░░▄▀▄▀░░███░░▄▀▄▀░░▄▀▄▀░░███░░▄▀░░█████████░░▄▀░░█████████░░▄▀░░██░░▄▀░░███░░▄▀░░███████░░▄▀░░█████████████████
  12. █░░░░▄▀▄▀▄▀░░░░█░░░░▄▀░░██░░▄▀░░░░█░░▄▀░░█████████░░▄▀░░░░░░░░░░█░░▄▀░░░░░░▄▀░░█░░░░▄▀░░░░█████░░▄▀░░█████████████████
  13. ███░░░░▄▀░░░░███░░▄▀▄▀░░██░░▄▀▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀░░█████░░▄▀░░█████████████████
  14. █████░░░░░░█████░░░░░░░░██░░░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░█████░░░░░░█████████████████
  15.  
  16.  
  17. ░]]--
  18.  
  19. print("Loading AIMBLOX script . . . Vxploits . . .")
  20. wait(3)
  21. print("Detected device")
  22. wait(1)
  23. print("Loaded!")
  24.  
  25. game.StarterGui:SetCore("SendNotification", {
  26.     Title = "VXPLOIT!";
  27.     Text = "Copied our discord to your clipboard!";
  28.     Icon = "";
  29.     Duration = "12";
  30. })
  31.  
  32. setclipboard("https://discord.gg/X3a5JcFS")
  33. toclipboard("https://discord.gg/X3a5JcFS")
  34.  
  35.  
  36.  
  37.  
  38. local drawing_new = Drawing.new
  39. local instance_new = Instance.new
  40.  
  41. -- workspace
  42. local vector2_new = Vector2.new
  43. local vector3_new = Vector3.new
  44. local cframe_new = CFrame.new
  45. local cframe_angles = CFrame.Angles
  46. local raycast_params_new = RaycastParams.new
  47. local raycast = workspace.Raycast
  48.  
  49. -- color
  50. local color3_rgb = Color3.fromRGB
  51. local color3_hsv = Color3.fromHSV
  52. local color3_new = Color3.new
  53.  
  54. -- math
  55. local math_floor = math.floor
  56. local math_ceil = math.ceil
  57. local math_atan2 = math.atan2
  58. local math_rad = math.rad
  59. local math_random = math.random
  60. local math_randomseed = math.randomseed
  61.  
  62. -- string
  63. local string_char = string.char
  64. local string_format = string.format
  65.  
  66. -- table
  67. local table_sort = table.sort
  68.  
  69. -- task
  70. local task_wait = task.wait
  71.  
  72. -- namecall
  73. local gdbd = game.GetDebugId
  74. local get_children = game.GetChildren
  75. local get_descendants = game.GetDescendants
  76. local find_first_child_of_class = game.FindFirstChildOfClass
  77. local find_first_child = game.FindFirstChild
  78. local is_descendant_of = game.IsDescendantOf
  79. local world_to_view_point = find_first_child_of_class(workspace, "Camera").WorldToViewportPoint
  80. local point_world_space = cframe_new().pointToWorldSpace
  81. local point_object_space = cframe_new().pointToObjectSpace
  82. local vector_world_space = cframe_new().vectorToWorldSpace
  83. local is_a = game.IsA
  84.  
  85. -- globals
  86. local workspace = workspace
  87. local pairs = pairs
  88. local pcall = pcall
  89. local tostring = tostring
  90. local tick = tick
  91. local getgenv = getgenv
  92. local mousemoverel = mousemoverel
  93. local mouse1press = mouse1press
  94. local mouse1release = mouse1release
  95.  
  96. -- random
  97. math_randomseed(tick())
  98. function random_string(len)
  99.     local str = ""
  100.     for i = 1, len do
  101.         str = str .. string_char(math_random(97, 122))
  102.     end
  103.     return str
  104. end
  105.  
  106. getgenv().render_loop_stepped_name = renderloop_stepped_name or random_string(math_random(15, 35))
  107. getgenv().update_loop_stepped_name = update_loop_stepped_name or random_string(math_random(15, 35))
  108.  
  109. -- services
  110. local players = game:GetService("Players")
  111. local run_service = game:GetService("RunService")
  112. local uis = game:GetService("UserInputService")
  113.  
  114. -- other
  115. local local_player = players.LocalPlayer
  116. local mouse = local_player:GetMouse()
  117.  
  118. local cam = find_first_child_of_class(workspace, "Camera")
  119.  
  120. local screen_size = cam.ViewportSize
  121. local center_screen = vector2_new(screen_size.X / 2, screen_size.Y / 2)
  122.  
  123. local enum_rft_blk = Enum.RaycastFilterType.Blacklist
  124. local glass = Enum.Material.Glass
  125.  
  126. local white = color3_rgb(255, 255, 255)
  127. local green = color3_rgb(0, 255, 0)
  128.  
  129. local dummy_part = instance_new("Part", nil)
  130.  
  131. drawing_new("Square").Visible = false -- initialize drawing lib
  132.  
  133. local pi = math.pi
  134.  
  135. -- dont touch lol
  136. local custom_players = true
  137. local refresh_que = false
  138. local start_aim = false
  139. local aim_head = false
  140. local added_fov = 0
  141.  
  142. -- execute to apply
  143. local options = {
  144.     -- global settings
  145.     frame_delay = 10, -- delay between rendering each frame (in miliseconds)
  146.     refresh_delay = 0.1, -- delay between refreshing script (in seconds)
  147.     max_dist = 9e9, -- 9e9 = very big
  148.     team_check = true,
  149.     wall_check = false,
  150.    
  151.     loop_all_humanoids = false, -- loop through workspace to find npc's to lock onto
  152.     ignore_player_humanoids = true, -- will not lock onto/esp players (only if loop_all_humanoids is enabled)
  153.  
  154.     -- ui settings (sort of ui)
  155.     fov_circle = true,
  156.     aiming_at = true,
  157.  
  158.     -- aimbot settings
  159.     aimbot = true,
  160.     smoothness = 2,
  161.     fov = 100,
  162.     fov_increase_on_aim = 0, -- increases your fov by this value while the aimbot is active
  163.     rage_mode = false, -- disregards fov, smoothness, odds and will lock onto people behind you
  164.  
  165.     -- aim type settings
  166.     mouse_emulation = true, -- the default, will emulate user input (and is more natural)
  167.     camera_cframe = false, -- aimlock, easier to detect, does not obey the smoothness setting but locks instantly
  168.  
  169.     -- will not lock on to people with this *username*, do not use a displayname for this, use the username
  170.     ignore_people = {
  171.         ["name"] = true, -- example of how you would exclude someone
  172.     },
  173.  
  174.     -- will try to prefire when aiming
  175.     triggerbot = false,
  176.  
  177.     -- aimbot activation settings
  178.     acts_as_toggle = false,
  179.    
  180.     -- https://developer.roblox.com/en-us/api-reference/enum/UserInputType
  181.     mouse_key = Enum.UserInputType["MouseButton2"],
  182.     -- how to disable: mouse_key = nil,
  183.     -- how to enable: mouse_key = Enum.UserInputType["*"],
  184.  
  185.     -- https://developer.roblox.com/en-us/api-reference/enum/KeyCode
  186.     keyboard_key = Enum.KeyCode["E"],
  187.     -- how to disable: keyboard_key = nil,
  188.     -- how to enable: keyboard_key = Enum.KeyCode["*"],
  189.  
  190.     -- headshot odds
  191.     headshot_chance = 100, -- odds for aiming on the head in percentage, 0 = no head (lol) and 100 = always head
  192.     update_on_refresh_delay = false, -- less nauseating, will recalculate odds every refresh instead of every frame
  193.  
  194.     -- aiming prioritization options
  195.     looking_at_you = false, -- whoever is most likely to hit you
  196.     closest_to_center_screen = true,
  197.     closest_to_you = false,
  198.  
  199.     -- taxing, usually useless, will iterate backwards through players list if the "best player to lock onto" cant be locked onto
  200.     backwards_iteration = false,
  201.  
  202.     -- global esp settings
  203.     esp = true,
  204.     esp_thickness = 2,
  205.    
  206.     -- esp settings
  207.     tracers = true,
  208.     box = true,
  209.  
  210.     -- overhead esp settings
  211.     overhead = true, -- disables name health and distance entirely
  212.     name = true,
  213.     distance = false,
  214.     health = false,
  215.     outline = true, -- text outline, laggier
  216.  
  217.     -- rainbow settings
  218.     rainbow = false,
  219.     rainbow_speed = 5, -- lower is faster, 0.000001 is the lowest you can go
  220.  
  221.     -- looking_at_tracer settings (lat = looking_at_tracer in short)
  222.     looking_at_tracer = true, -- will show where a player is looking
  223.  
  224.     --https://www.google.com/search?q=color+picker
  225.     lat_color = color3_rgb(200, 0, 255), -- color in rgb
  226.     lat_thickness = 2,
  227.     lat_length = 3, -- how far the tracer will go (in studs)
  228.    
  229.     -- crosshair settings
  230.     crosshair = false,
  231.  
  232.     crosshair_distance = 4,
  233.     crosshair_thickness = 1,
  234.     crosshair_length = 8;
  235. }
  236.  
  237. -- script already running?
  238. if remove_all_esp then
  239.     run_service:UnbindFromRenderStep(render_loop_stepped_name)
  240.     run_service:UnbindFromRenderStep(update_loop_stepped_name)
  241.  
  242.     task_wait() -- wait for a frame to pass
  243.  
  244.     remove_all_esp()
  245.  
  246.     if descendant_hum_added then
  247.         descendant_hum_added:Disconnect()
  248.         descendant_hum_removing:Disconnect()
  249.         player_name_added:Disconnect()
  250.         player_name_removed:Disconnect()
  251.     end
  252.  
  253.     player_added:Disconnect()
  254.     player_removed:Disconnect()
  255.  
  256.     input_began:Disconnect()
  257.     input_ended:Disconnect()
  258.  
  259.     getgenv().remove_all_esp = nil
  260.  
  261.     return;
  262. end
  263.  
  264. -- how the script will find the players
  265. local characters = {}
  266. local player_names = {}
  267.  
  268. local function get_players()
  269.     local place = game.PlaceId
  270.  
  271.     if options.loop_all_humanoids then
  272.         if not player_names[local_player.Name] then -- ran for the first time
  273.             -- get player names
  274.             for _, val in pairs(get_children(players)) do
  275.                 player_names[val.Name] = true
  276.             end
  277.  
  278.             getgenv().player_name_added = players.ChildAdded:Connect(function(added)
  279.                 player_names[added.Name] = true
  280.             end)
  281.  
  282.             getgenv().player_name_removed = players.ChildRemoved:Connect(function(added)
  283.                 player_names[added.Name] = nil
  284.             end)
  285.  
  286.             -- get players with events
  287.             for _, val in pairs(workspace:GetDescendants()) do
  288.                 if is_a(val, "Humanoid") and val.Parent ~= local_player.Character and not (options.ignore_player_humanoids and player_names[val.Parent.Name]) then
  289.                     characters[gdbd(val.Parent)] = val.Parent
  290.                 end
  291.             end
  292.  
  293.             getgenv().descendant_hum_added = workspace.DescendantAdded:Connect(function(added)
  294.                 if is_a(added, "Humanoid") and added.Parent ~= local_player.Character and not (options.ignore_player_humanoids and player_names[added.Parent.Name]) then
  295.                     characters[gdbd(added.Parent)] = added.Parent
  296.                 end
  297.             end)
  298.            
  299.             getgenv().descendant_hum_removing = workspace.DescendantRemoving:Connect(function(removing)
  300.                 if is_a(removing, "Humanoid") then
  301.                     characters[gdbd(removing.Parent)] = nil
  302.                 end
  303.             end)
  304.         end
  305.  
  306.         return characters
  307.     end
  308.  
  309.     if place == 292439477 then -- phantom forces
  310.         local leaderboard = local_player.PlayerGui.Leaderboard.Main
  311.  
  312.         if leaderboard then
  313.             if options.team_check then
  314.                 local is_ghost = pcall(function()
  315.                     return leaderboard.Ghosts.DataFrame.Data[local_player.Name]
  316.                 end)
  317.                
  318.                 return get_children(workspace.Players[(is_ghost and "Bright blue") or "Bright orange"])
  319.             else
  320.                 local instance_table = {}
  321.  
  322.                 for idx, val in pairs(get_children(workspace.Players["Bright blue"])) do
  323.                     if is_a(val, "Model") then
  324.                         instance_table[#instance_table + 1] = val
  325.                     end
  326.                 end
  327.  
  328.                 for idx, val in pairs(get_children(workspace.Players["Bright orange"])) do
  329.                     if is_a(val, "Model") then
  330.                         instance_table[#instance_table + 1] = val
  331.                     end
  332.                 end
  333.  
  334.                 return instance_table -- return both teams
  335.             end
  336.         end
  337.  
  338.         return {} -- wtf???
  339.     end
  340.  
  341.     if place == 3837841034 then
  342.         return get_children(workspace.characters)
  343.     end
  344.  
  345.     if place == 5938036553 then
  346.         local chars = {}
  347.  
  348.         for _, val in pairs(get_children(workspace)) do
  349.             if val.Name == "r15_rig" then
  350.                 chars[#chars + 1] = val
  351.             end
  352.         end
  353.  
  354.         return chars
  355.     end
  356.  
  357.     custom_players = false
  358.     return get_children(players)
  359. end
  360.  
  361. local aiming = {
  362.     fov_circle_obj = nil,
  363.     line = nil,
  364.     circle = nil;
  365. }
  366.  
  367. local crosshair = {
  368.     top = nil,
  369.     bottom = nil,
  370.     right = nil,
  371.     left = nil;
  372. }
  373.  
  374. local players_table = {}
  375. local tracers = {}
  376. local quads = {}
  377. local overheads = {}
  378. local looking_at_tracers = {}
  379.  
  380. -- needed functions
  381. local function to_screen(vec3)
  382.     local screen_pos, in_screen = world_to_view_point(cam, vec3)
  383.    
  384.     return vector2_new(screen_pos.X, screen_pos.Y), in_screen, screen_pos, options.rage_mode
  385. end
  386.  
  387. local function get_part_corners(part)
  388.     local size = part.Size * vector3_new(1, 1.5, 0)
  389.  
  390.     local cf = part.CFrame
  391.  
  392.     return {
  393.         top_right = (cf * cframe_new(-size.X, -size.Y, 0)).Position,
  394.         bottom_right = (cf * cframe_new(-size.X, size.Y, 0)).Position,
  395.         top_left = (cf * cframe_new(size.X, -size.Y, 0)).Position,
  396.         bottom_left = (cf * cframe_new(size.X, size.Y, 0)).Position,
  397.     }
  398. end
  399.  
  400. local function new_drawing(class_name)
  401.     return function(props)
  402.         local inst = drawing_new(class_name)
  403.  
  404.         for idx, val in pairs(props) do
  405.             if idx ~= "instance" then
  406.                 inst[idx] = val
  407.             end
  408.         end
  409.        
  410.         return inst
  411.     end
  412. end
  413.  
  414. local function add_or_update_instance(tbl, child, props)
  415.     local inst = tbl[child]
  416.     if not inst then
  417.         tbl[child] = new_drawing(props.instance)(props)
  418.  
  419.         return inst;
  420.     end
  421.  
  422.     for idx, val in pairs(props) do
  423.         if idx ~= "instance" then
  424.             inst[idx] = val
  425.         end
  426.     end
  427.  
  428.     return inst
  429. end
  430.  
  431. local function get_rainbow()
  432.     return color3_hsv((tick() % options.rainbow_speed / options.rainbow_speed), 1, 1)
  433. end
  434.  
  435. local function remove_esp(idx)
  436.     add_or_update_instance(tracers, idx, {
  437.         Visible = false,
  438.         instance = "Line"
  439.     })
  440.  
  441.     add_or_update_instance(quads, idx, {
  442.         Visible = false,
  443.         instance = "Quad"
  444.     })
  445.  
  446.     add_or_update_instance(overheads, idx, {
  447.         Visible = false,
  448.         instance = "Text"
  449.     })
  450.  
  451.     add_or_update_instance(looking_at_tracers, idx, {
  452.         Visible = false,
  453.         instance = "Line"
  454.     })
  455. end
  456.  
  457. local ignored_instances = {}
  458.  
  459. local raycast_params = raycast_params_new()
  460. raycast_params.FilterType = enum_rft_blk
  461. raycast_params.IgnoreWater = true
  462.  
  463. local function can_hit(origin_pos, part)
  464.     if not options.wall_check then
  465.         return true
  466.     end
  467.  
  468.     local ignore_list = {cam, local_player.Character}
  469.  
  470.     for idx, val in pairs(ignored_instances) do
  471.         ignore_list[#ignore_list + 1] = val
  472.     end
  473.  
  474.     raycast_params.FilterDescendantsInstances = ignore_list
  475.    
  476.     local raycast_result = raycast(workspace, origin_pos, (part.Position - origin_pos).Unit * options.max_dist, raycast_params)
  477.  
  478.     local result_part = ((raycast_result and raycast_result.Instance) or dummy_part)
  479.  
  480.     if result_part ~= dummy_part then
  481.         if result_part.Transparency >= 0.3 then -- ignore low transparency
  482.             ignored_instances[#ignored_instances + 1] = result_part
  483.         end
  484.  
  485.         if result_part.Material == glass then -- ignore glass
  486.             ignored_instances[#ignored_instances + 1] = result_part
  487.         end
  488.     end
  489.  
  490.     return is_descendant_of(result_part, part.Parent)
  491. end
  492.  
  493. local function hitting_what(origin_cframe)
  494.     if not options.wall_check then
  495.         return dummy_part
  496.     end
  497.  
  498.     local ignore_list = {cam, local_player.Character}
  499.  
  500.     for idx, val in pairs(ignored_instances) do
  501.         ignore_list[#ignore_list + 1] = val
  502.     end
  503.    
  504.     raycast_params.FilterDescendantsInstances = ignore_list
  505.    
  506.     local raycast_result = raycast(workspace, origin_cframe.p, origin_cframe.LookVector * options.max_dist, raycast_params)
  507.  
  508.     local result_part = ((raycast_result and raycast_result.Instance) or dummy_part)
  509.    
  510.     if result_part ~= dummy_part then
  511.         if result_part.Transparency >= 0.3 then -- ignore low transparency
  512.             ignored_instances[#ignored_instances + 1] = result_part
  513.         end
  514.  
  515.         if result_part.Material == glass then -- ignore glass
  516.             ignored_instances[#ignored_instances + 1] = result_part
  517.         end
  518.     end
  519.  
  520.     return result_part
  521. end
  522.  
  523. local function is_inside_fov(point)
  524.     return options.rage_mode or ((point.x - center_screen.X) ^ 2 + (point.y - center_screen.Y) ^ 2 <= aiming.fov_circle_obj.Radius ^ 2)
  525. end
  526.  
  527. local function chanced() -- shanced 2 - 0 gf *tabs*
  528.     return options.rage_mode or math_random(1, 100) <= options.headshot_chance
  529. end
  530.  
  531. local function screen_height(yval)
  532.     if yval > (screen_size.Y / 2) then
  533.         return -0.5
  534.     end
  535.  
  536.     return 0.5
  537. end
  538.  
  539. local function _refresh()
  540.     for idx in pairs(tracers) do -- hide all esp instances
  541.         remove_esp(idx)
  542.     end
  543.  
  544.     players_table = get_players() -- fetch new player list
  545. end
  546.  
  547. local function refresh()
  548.     refresh_que = true -- queue refresh before next render
  549. end
  550.  
  551. -- player events
  552. getgenv().player_added = players.ChildAdded:Connect(refresh)
  553. getgenv().player_removed = players.ChildRemoved:Connect(refresh)
  554.  
  555. -- aimbot triggers
  556. getgenv().input_began = uis.InputBegan:Connect(function(input)
  557.     if input.KeyCode == options.keyboard_key then
  558.         if options.acts_as_toggle then
  559.             start_aim = not start_aim
  560.         else
  561.             start_aim = true
  562.         end
  563.  
  564.         if options.fov_increase_on_aim > 0 then
  565.             for i = 1, options.fov_increase_on_aim * 0.3 do
  566.                 added_fov = added_fov + 3
  567.                 task_wait()
  568.             end
  569.  
  570.             added_fov = options.fov_increase_on_aim
  571.         end
  572.     end
  573.  
  574.     if input.UserInputType == options.mouse_key then
  575.         if options.acts_as_toggle then
  576.             start_aim = not start_aim
  577.         else
  578.             start_aim = true
  579.         end
  580.  
  581.         if options.fov_increase_on_aim > 0 then
  582.             for i = 1, options.fov_increase_on_aim * 0.3 do
  583.                 added_fov = added_fov + 3
  584.                 task_wait()
  585.             end
  586.  
  587.             added_fov = options.fov_increase_on_aim
  588.         end
  589.     end
  590. end)
  591.  
  592. getgenv().input_ended = uis.InputEnded:Connect(function(input)
  593.     if input.KeyCode == options.keyboard_key then
  594.         if not options.acts_as_toggle then
  595.             start_aim = false
  596.         end
  597.  
  598.         if options.fov_increase_on_aim > 0 then
  599.             for i = 1, options.fov_increase_on_aim * 0.3 do
  600.                 added_fov = added_fov - 3
  601.                
  602.                 task_wait()
  603.             end
  604.  
  605.             added_fov = 0
  606.         end
  607.     end
  608.  
  609.     if input.UserInputType == options.mouse_key then
  610.         if not options.acts_as_toggle then
  611.             start_aim = false
  612.         end
  613.  
  614.         if options.fov_increase_on_aim > 0 then
  615.             for i = 1, options.fov_increase_on_aim * 0.3 do
  616.                 added_fov = added_fov - 3
  617.  
  618.                 task_wait()
  619.             end
  620.  
  621.             added_fov = 0
  622.         end
  623.     end
  624. end)
  625.  
  626. local last_tick = 0;
  627.  
  628. local function stepped()
  629.     if (tick() - last_tick) > (options.frame_delay / 1000) then
  630.         last_tick = tick()
  631.  
  632.         if refresh_que then -- refresh queed?
  633.             _refresh()
  634.            
  635.             refresh_que = false
  636.         end
  637.  
  638.         add_or_update_instance(aiming, "fov_circle_obj", {
  639.             Visible = options.fov_circle,
  640.             Thickness = options.esp_thickness,
  641.             Radius = options.fov + added_fov,
  642.             Position = center_screen,
  643.             Color = (options.rainbow and get_rainbow()) or white,
  644.             instance = "Circle";
  645.         })
  646.    
  647.         add_or_update_instance(crosshair, "top", {
  648.             Visible = options.crosshair,
  649.             Thickness = options.crosshair_thickness,
  650.             From = vector2_new(center_screen.X, center_screen.Y - options.crosshair_length - options.crosshair_distance),
  651.             To = vector2_new(center_screen.X, center_screen.Y - options.crosshair_distance),
  652.             Color = (options.rainbow and get_rainbow()) or white,
  653.             instance = "Line";
  654.         })
  655.    
  656.         add_or_update_instance(crosshair, "bottom", {
  657.             Visible = options.crosshair,
  658.             Thickness = options.crosshair_thickness,
  659.             From = vector2_new(center_screen.X, center_screen.Y + options.crosshair_length + options.crosshair_distance + 1),
  660.             To = vector2_new(center_screen.X, center_screen.Y + options.crosshair_distance + 1),
  661.             Color = (options.rainbow and get_rainbow()) or white,
  662.             instance = "Line";
  663.         })
  664.    
  665.         add_or_update_instance(crosshair, "left", {
  666.             Visible = options.crosshair,
  667.             Thickness = options.crosshair_thickness,
  668.             From = vector2_new(center_screen.X - options.crosshair_length - options.crosshair_distance, center_screen.Y),
  669.             To = vector2_new(center_screen.X - options.crosshair_distance, center_screen.Y),
  670.             Color = (options.rainbow and get_rainbow()) or white,
  671.             instance = "Line";
  672.         })
  673.        
  674.         add_or_update_instance(crosshair, "right", {
  675.             Visible = options.crosshair,
  676.             Thickness = options.crosshair_thickness,
  677.             From = vector2_new(center_screen.X + options.crosshair_length + options.crosshair_distance + 1, center_screen.Y),
  678.             To = vector2_new(center_screen.X + options.crosshair_distance + 1, center_screen.Y),
  679.             Color = (options.rainbow and get_rainbow()) or white,
  680.             instance = "Line";
  681.         })
  682.  
  683.         local closers_chars = {}
  684.  
  685.         for _, plr in pairs(players_table) do
  686.             local id = gdbd(plr)
  687.  
  688.             if plr == local_player then continue; end
  689.  
  690.             if options.ignore_people[plr.Name] then continue; end
  691.  
  692.             if options.team_check and not options.loop_all_humanoids and not custom_players and plr.Team then
  693.                 if plr.TeamColor == local_player.TeamColor then remove_esp(id); continue; end
  694.                 if plr.Team == local_player.Team then remove_esp(id); continue; end
  695.             end
  696.  
  697.             local plr_char = ((options.loop_all_humanoids or custom_players) and plr) or plr.Character
  698.             if plr_char == nil then remove_esp(id); continue; end
  699.  
  700.             local root_part =
  701.                 find_first_child(plr_char, "Torso")
  702.                 or find_first_child(plr_char, "UpperTorso")
  703.                 or find_first_child(plr_char, "LowerTorso")
  704.                 or find_first_child(plr_char, "HumanoidRootPart")
  705.                 or find_first_child(plr_char, "Head")
  706.                 or find_first_child_of_class(plr_char, "BasePart")
  707.                
  708.             if root_part == nil then remove_esp(id); continue; end
  709.             if not is_a(root_part, "BasePart") then remove_esp(id); continue; end
  710.            
  711.             local head = find_first_child(plr_char, "Head") or root_part
  712.             if not is_a(head, "BasePart") then continue; end
  713.  
  714.             local plr_screen, visible, scr_z = to_screen(head.Position)
  715.             local mag = (head.Position - cam.CFrame.Position).Magnitude
  716.  
  717.             if mag > options.max_dist then remove_esp(id); continue; end
  718.  
  719.             if options.esp then
  720.                 local col = (options.rainbow and get_rainbow()) or white
  721.                 local corners = get_part_corners(root_part)
  722.  
  723.                 local a_screen, a_visible = to_screen(corners.top_left)
  724.                 local b_screen, b_visible = to_screen(corners.top_right)
  725.                 local c_screen, c_visible = to_screen(corners.bottom_right)
  726.                 local d_screen, d_visible = to_screen(corners.bottom_left)
  727.  
  728.                 if options.tracers then -- doesnt have a hide condition
  729.                     local object_space_pos = point_object_space(cam.CFrame, vector3_new(
  730.                         (corners.top_left.X + corners.top_right.X) / 2,
  731.                         (corners.top_left.Y + corners.top_right.Y) / 2,
  732.                         (corners.top_left.Z + corners.top_right.Z) / 2
  733.                     ))
  734.                    
  735.                     if 0 > scr_z.Z then -- thanks unnamed esp for the math
  736.                         local angle = math_atan2(object_space_pos.Y, object_space_pos.X) + pi
  737.                         object_space_pos = vector_world_space(cframe_angles(0, 0, angle), (cframe_angles(0, math_rad(89.99), 0).LookVector))
  738.                     end
  739.                    
  740.                     local tracer_pos = to_screen(point_world_space(cam.CFrame, object_space_pos))
  741.                    
  742.                     add_or_update_instance(tracers, id, {
  743.                         Visible = options.esp,
  744.                         Thickness = options.esp_thickness,
  745.                         From = vector2_new(screen_size.X / 2, screen_size.Y - 36),
  746.                         To = tracer_pos,
  747.                         Color = (options.rainbow and get_rainbow()) or color3_new(255 / mag, mag / 255, 0),
  748.                         instance = "Line";
  749.                     })
  750.                 end
  751.  
  752.                 if options.box then
  753.                     if a_visible and b_visible and c_visible and d_visible then
  754.                         add_or_update_instance(quads, id, {
  755.                             Visible = options.esp,
  756.                             Thickness = options.esp_thickness,
  757.                             PointA = a_screen,
  758.                             PointB = b_screen,
  759.                             PointC = c_screen,
  760.                             PointD = d_screen,
  761.                             Color = col,
  762.                             instance = "Quad";
  763.                         })
  764.                     else
  765.                         add_or_update_instance(quads, id, {
  766.                             Visible = false,
  767.                             instance = "Quad";
  768.                         })
  769.                     end
  770.                 end
  771.  
  772.                 if options.looking_at_tracer then
  773.                     local a_head_src, a_visible = to_screen(head.Position)
  774.                     local b_lv_src, b_visible = to_screen(head.Position + head.CFrame.LookVector * options.lat_length)
  775.  
  776.                     if a_visible and b_visible then
  777.                         add_or_update_instance(looking_at_tracers, id, {
  778.                             Visible = options.esp,
  779.                             Thickness = options.lat_thickness,
  780.                             To = a_head_src,
  781.                             From = b_lv_src,
  782.                             Color = options.lat_color or white,
  783.                             instance = "Line";
  784.                         })
  785.                     else
  786.                         add_or_update_instance(looking_at_tracers, id, {
  787.                             Visible = false,
  788.                             instance = "Line";
  789.                         })
  790.                     end
  791.                 end
  792.  
  793.                 if options.overhead then
  794.                     local text = "";
  795.  
  796.                     if options.health then
  797.                         local hum = find_first_child_of_class(plr_char, "Humanoid")
  798.  
  799.                         if hum then
  800.                             text = string_format("%s[%d/%d] ", text, math_ceil(hum.Health), math_ceil(hum.MaxHealth))
  801.                         end
  802.                     end
  803.  
  804.                     if options.distance then
  805.                         text = string_format("%s[%d]\n", text, math_floor(mag))
  806.                     end
  807.  
  808.                     if options.name then
  809.                         text = string_format("%s%s ", text, plr.Name)
  810.                     end
  811.    
  812.                     local head_screen, h_visible = to_screen(head.Position + head.CFrame.UpVector * 2)
  813.  
  814.                     if h_visible then
  815.                         local obj = overheads[id]
  816.  
  817.                         add_or_update_instance(overheads, id, {
  818.                             Visible = options.esp,
  819.                             Outline = options.outline,
  820.                             Center = true,
  821.                             Position = head_screen - vector2_new(0, (obj and obj.TextBounds.Y) or 0),  
  822.                             Text = text,
  823.                             Color = col,
  824.                             instance = "Text";
  825.                         })
  826.                     else
  827.                         add_or_update_instance(overheads, id, {
  828.                             Visible = false,
  829.                             instance = "Text";
  830.                         })
  831.                     end
  832.                 end
  833.             end
  834.  
  835.             if options.aimbot then
  836.                 if options.looking_at_you then
  837.                     closers_chars[((head.Position + head.CFrame.LookVector * mag) - cam.CFrame.p).Magnitude] = plr_char
  838.                 elseif options.closest_to_center_screen then
  839.                     closers_chars[(plr_screen - center_screen).Magnitude] = plr_char
  840.                 elseif options.closest_to_you then
  841.                     closers_chars[mag] = plr_char
  842.                 end
  843.             end
  844.         end -- sort players, esp, teamcheck
  845.  
  846.         if not options.aimbot then return; end
  847.  
  848.         local mags = {}
  849.  
  850.         for idx in pairs(closers_chars) do
  851.             mags[#mags + 1] = idx
  852.         end
  853.  
  854.         table_sort(mags)
  855.  
  856.         local idx_sorted = {}
  857.  
  858.         for _, idx in pairs(mags) do
  859.             idx_sorted[#idx_sorted + 1] = closers_chars[idx]
  860.         end
  861.  
  862.         local run_aimbot = nil;
  863.         run_aimbot = function(plr_offset)
  864.             local char = idx_sorted[plr_offset]
  865.  
  866.             if char then
  867.                 local children = get_children(char)
  868.                 local parts = {}
  869.  
  870.                 for _, obj in pairs(children) do
  871.                     if is_a(obj, "BasePart") then
  872.                         local part_screen, part_in_screen, _, rage = to_screen(obj.Position)
  873.  
  874.                         if can_hit(cam.CFrame.p, obj) and (part_in_screen or rage) and (is_inside_fov(part_screen) or rage) then
  875.                             local set = {
  876.                                 part = obj,
  877.                                 screen = part_screen,
  878.                                 visible = part_in_screen;
  879.                             }
  880.  
  881.                             parts[obj.Name] = set
  882.  
  883.                             parts[0] = set -- set last part
  884.                         end
  885.                     end
  886.                 end
  887.  
  888.                 local chosen = nil;
  889.  
  890.                 if not options.update_on_refresh_delay then
  891.                     aim_head = chanced()
  892.                 end
  893.  
  894.                 if parts["Head"] and aim_head then
  895.                     chosen = parts["Head"]
  896.                 else
  897.                     local torso = parts["Torso"] or parts["UpperTorso"] or parts["LowerTorso"]
  898.                     if torso then
  899.                         chosen = torso
  900.                     else
  901.                         chosen = parts["Head"] or parts[0] -- aim on head if odds are against the head, but the torso isnt visible, or on other visible part
  902.                     end
  903.                 end
  904.                
  905.                 if chosen then
  906.                     local scale = (chosen.part.Size.Y / 2)
  907.  
  908.                     local top, top_z, top_visible = to_screen((chosen.part.CFrame * cframe_new(0, scale, 0)).Position);
  909.                     local bottom, bottom_z, bottom_visible = to_screen((chosen.part.CFrame * cframe_new(0, -scale, 0)).Position);
  910.                     local radius = -(top - bottom).y;
  911.  
  912.                     add_or_update_instance(aiming, "circle", {
  913.                         Visible = top_visible and bottom_visible and options.aiming_at,
  914.                         Thickness = options.esp_thickness,
  915.                         Radius = radius / 2,
  916.                         Position = chosen.screen,
  917.                         Color = (options.rainbow and get_rainbow()) or (start_aim and green) or white,
  918.                         instance = "Circle";
  919.                     })
  920.  
  921.                     if start_aim then
  922.                         add_or_update_instance(aiming, "line", {
  923.                             Visible = options.aiming_at,
  924.                             Thickness = options.esp_thickness,
  925.                             From = center_screen,
  926.                             To = chosen.screen,
  927.                             Color = (options.rainbow and get_rainbow()) or (start_aim and green) or white,
  928.                             instance = "Line";
  929.                         })
  930.  
  931.                         local smoothness = (options.rage_mode and 1) or options.smoothness
  932.  
  933.                         if chosen.visible then
  934.                             if options.mouse_emulation then
  935.                                 mousemoverel((chosen.screen.X - mouse.X) / smoothness, (chosen.screen.Y - (mouse.Y + 36)) / smoothness)
  936.                             elseif options.camera_cframe then
  937.                                 cam.CFrame = cframe_new(cam.CFrame.p, chosen.part.Position)
  938.                             end
  939.                         elseif options.rage_mode then
  940.                             if options.mouse_emulation then
  941.                                 mousemoverel(screen_size.X / 4, (chosen.screen.Y - (mouse.Y + 36)) * screen_height(mouse.Y))
  942.                             elseif options.camera_cframe then
  943.                                 cam.CFrame = cframe_new(cam.CFrame.p, chosen.part.Position)
  944.                             end
  945.                         end
  946.  
  947.                         if options.triggerbot then
  948.                             if is_descendant_of(hitting_what(cam.CFrame), chosen.part.Parent) then
  949.                                 mouse1press()
  950.                             else
  951.                                 mouse1release()
  952.                             end
  953.                         end
  954.  
  955.                         return;
  956.                     else
  957.                         if options.triggerbot then
  958.                             mouse1release()
  959.                         end
  960.                        
  961.                         add_or_update_instance(aiming, "line", {
  962.                             Visible = false,
  963.                             instance = "Line";
  964.                         })
  965.  
  966.                         return;
  967.                     end -- aiming?
  968.  
  969.                     return; -- part is on screen, and in fov, no need to find a new player, loop ends here
  970.                 end -- part exists?
  971.  
  972.                 if options.triggerbot then
  973.                     mouse1release()
  974.                 end
  975.  
  976.                 add_or_update_instance(aiming, "line", {
  977.                     Visible = false,
  978.                     instance = "Line";
  979.                 })
  980.  
  981.                 add_or_update_instance(aiming, "circle", {
  982.                     Visible = false,
  983.                     instance = "Circle";
  984.                 })
  985.  
  986.                 if options.backwards_iteration then
  987.                     run_aimbot(plr_offset + 1); -- previous player
  988.                 end
  989.             end
  990.         end
  991.  
  992.         run_aimbot(1);
  993.     end
  994. end
  995.  
  996. local last_refresh = 0;
  997.  
  998. run_service:BindToRenderStep(render_loop_stepped_name, 300, function()
  999.     if (tick() - last_refresh) > options.refresh_delay then
  1000.         last_refresh = tick()
  1001.  
  1002.         if not cam or not cam.Parent or cam.Parent ~= workspace then
  1003.             cam = find_first_child_of_class(workspace, "Camera")
  1004.  
  1005.             world_to_view_point = cam.WorldToViewportPoint
  1006.         end
  1007.  
  1008.         if options.update_on_refresh_delay then
  1009.             aim_head = chanced()
  1010.         end
  1011.  
  1012.         refresh()
  1013.     end
  1014. end) -- refresher
  1015.  
  1016. run_service:BindToRenderStep(update_loop_stepped_name, 199, stepped)
  1017.  
  1018. -- kills esp
  1019. getgenv().remove_all_esp = function()
  1020.     for idx in pairs(tracers) do -- hide all esp instances
  1021.         remove_esp(idx)
  1022.     end
  1023.  
  1024.     -- aiming
  1025.     add_or_update_instance(aiming, "fov_circle_obj", {
  1026.         Visible = false,
  1027.         instance = "Circle";
  1028.     })
  1029.  
  1030.     add_or_update_instance(aiming, "circle", {
  1031.         Visible = false,
  1032.         instance = "Circle";
  1033.     })
  1034.  
  1035.     add_or_update_instance(aiming, "line", {
  1036.         Visible = false,
  1037.         instance = "Line";
  1038.     })
  1039.    
  1040.     -- crosshair
  1041.     add_or_update_instance(crosshair, "top", {
  1042.         Visible = false,
  1043.         instance = "Line";
  1044.     })
  1045.  
  1046.     add_or_update_instance(crosshair, "bottom", {
  1047.         Visible = false,
  1048.         instance = "Line";
  1049.     })
  1050.  
  1051.     add_or_update_instance(crosshair, "left", {
  1052.         Visible = false,
  1053.         instance = "Line";
  1054.     })
  1055.    
  1056.     add_or_update_instance(crosshair, "right", {
  1057.         Visible = false,
  1058.         instance = "Line";
  1059.     })
  1060. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement