Advertisement
DGAB_YT

Counter Blox AIM BOT

Mar 25th, 2020 (edited)
2,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.61 KB | None | 0 0
  1. -- Made by DGAB
  2. --Discord Server https://discord.gg/Y93Dad7
  3.  
  4. game.StarterGui:SetCore("SendNotification", {
  5.     Title = "Made By DGAB",
  6.     Text = "Counter Blox Aimbot"
  7.     })
  8.    
  9.     local plrs = game:GetService("Players")
  10.     local TeamBased = true ; local teambasedswitch = "o"
  11.     local presskeytoaim = true; local aimkey = "e"
  12.     local raycast = false
  13.    
  14.     local espupdatetime = 5; autoesp = false
  15.    
  16.    
  17.    
  18.     local lockaim = true; local lockangle = 5
  19.    
  20.    
  21.    
  22.     --function findwat(folder, what)
  23.     --  for i, smth in pairs(folder:GetChildren()) do
  24.     --      if string.find(string.lower(tostring(smth)), string.lower(what)) then
  25.     --          return smth
  26.     --      end
  27.     --  end
  28.     --end
  29.     --
  30.     --local plrs = findwat(game, "Players")
  31.    
  32.    
  33.    
  34.    
  35.     local Gui = Instance.new("ScreenGui")
  36.     local Move = Instance.new("Frame")
  37.     local Main = Instance.new("Frame")
  38.     local EspStatus = Instance.new("TextLabel")
  39.     local st1 = Instance.new("TextLabel")
  40.     local st1_2 = Instance.new("TextLabel")
  41.     local st1_3 = Instance.new("TextLabel")
  42.     local Name = Instance.new("TextLabel")
  43.     --Properties:
  44.     Gui.Name = "Gui"
  45.     Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
  46.    
  47.     Move.Name = "Move"
  48.     Move.Parent = Gui
  49.     Move.BackgroundColor3 = Color3.new(0.631373, 0.631373, 0.631373)
  50.     Move.BackgroundTransparency = 0.40000000596046
  51.     Move.BorderSizePixel = 0
  52.     Move.Position = UDim2.new(0.005, 0,0.018, 0)
  53.     Move.Size = UDim2.new(0.28141585, 0, 0.0320388414, 0)
  54.    
  55.     Main.Name = "Main"
  56.     Main.Parent = Move
  57.     Main.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  58.     Main.BackgroundTransparency = 0.69999998807907
  59.     Main.Position = UDim2.new(0, 0, 0.995670795, 0)
  60.     Main.Size = UDim2.new(1.0000006, 0, 9.79697132, 0)
  61.    
  62.     EspStatus.Name = "EspStatus"
  63.     EspStatus.Parent = Main
  64.     EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
  65.     EspStatus.BackgroundTransparency = 1
  66.     EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
  67.     EspStatus.Font = Enum.Font.ArialBold
  68.     EspStatus.Text = "Press T to update Esp"
  69.     EspStatus.TextColor3 = Color3.fromRGB(51, 204, 204)
  70.     EspStatus.TextScaled = true
  71.     EspStatus.TextSize = 14
  72.     EspStatus.TextWrapped = true
  73.    
  74.     st1.Name = "st1"
  75.     st1.Parent = Main
  76.     st1.BackgroundColor3 = Color3.new(1, 1, 1)
  77.     st1.BackgroundTransparency = 1
  78.     st1.Position = UDim2.new(0.271787882, 0, 0, 0)
  79.     st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
  80.     st1.Font = Enum.Font.ArialBold
  81.     st1.Text = "Press "..aimkey.." to lock on a person inside ur view"
  82.     st1.TextColor3 = Color3.fromRGB(51, 204, 204)
  83.     st1.TextScaled = true
  84.     st1.TextSize = 14
  85.     st1.TextWrapped = true
  86.    
  87.     st1_2.Name = "st1"
  88.     st1_2.Parent = Main
  89.     st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
  90.     st1_2.BackgroundTransparency = 1
  91.     st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
  92.     st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  93.     st1_2.Font = Enum.Font.ArialBold
  94.     st1_2.Text = "Press L to enable esp loop"
  95.     st1_2.TextColor3 = Color3.fromRGB(51, 204, 204)
  96.     st1_2.TextScaled = true
  97.     st1_2.TextSize = 14
  98.     st1_2.TextWrapped = true
  99.    
  100.     st1_3.Name = "st1"
  101.     st1_3.Parent = Main
  102.     st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
  103.     st1_3.BackgroundTransparency = 1
  104.     st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
  105.     st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  106.     st1_3.Font = Enum.Font.ArialBold
  107.     st1_3.Text = "Press O to change team based mode"
  108.     st1_3.TextColor3 = Color3.fromRGB(51, 204, 204)
  109.     st1_3.TextScaled = true
  110.     st1_3.TextSize = 14
  111.     st1_3.TextWrapped = true
  112.     local teambasedstatus = st1_3:Clone()
  113.     teambasedstatus.Parent = st1_3
  114.     teambasedstatus.TextScaled = true
  115.     teambasedstatus.Position = UDim2.new(0, 0,0.694, 0)
  116.     teambasedstatus.Text = tostring(TeamBased)
  117.    
  118.     Name.Name = "Name"
  119.     Name.Parent = Move
  120.     Name.BackgroundColor3 = Color3.new(1, 1, 1)
  121.     Name.BackgroundTransparency = 1
  122.     Name.Size = UDim2.new(0.838, 0, 0.980000019, 0)
  123.     Name.Font = Enum.Font.Cartoon
  124.     Name.Text = "GUI by DGAB"
  125.     Name.TextColor3 = Color3.new(0, 0, 0)
  126.     Name.TextScaled = true
  127.     Name.TextSize = 14
  128.     Name.TextWrapped = true
  129.     Name.TextXAlignment = Enum.TextXAlignment.Left
  130.     -- Scripts:
  131.    
  132.    
  133.     local plrsforaim = {}
  134.    
  135.     local lplr = game:GetService("Players").LocalPlayer
  136.     Move.Draggable = true
  137.     Gui.ResetOnSpawn = false
  138.     Gui.Name = "Chat"
  139.     Gui.DisplayOrder = 999
  140.    
  141.         Gui.Parent = plrs.LocalPlayer.PlayerGui
  142.    
  143.    
  144.     f = {}
  145.     local espforlder
  146.    
  147.     f.addesp = function()
  148.         --print("ESP ran")
  149.         if espforlder then
  150.         else
  151.             espforlder = Instance.new("Folder")
  152.             espforlder.Parent = game.Workspace.CurrentCamera
  153.         end
  154.         for i, v in pairs(espforlder:GetChildren()) do
  155.             v:Destroy()
  156.         end
  157.         for _, plr in pairs(plrs:GetChildren()) do
  158.             if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  159.                 if TeamBased == true then
  160.                     if plr.Team.Name ~= plrs.LocalPlayer.Team.Name  then
  161.                         local e = espforlder:FindFirstChild(plr.Name)
  162.                         if not e then
  163.                             --print("Added esp for team based")
  164.                             local bill = Instance.new("BillboardGui", espforlder)
  165.                             bill.Name = plr.Name
  166.                             bill.AlwaysOnTop = true
  167.                             bill.Size = UDim2.new(1,0,1,0)
  168.                             bill.Adornee = plr.Character.Head
  169.                             local Frame = Instance.new('Frame',bill)
  170.                             Frame.Active = true
  171.                             Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  172.                             Frame.BackgroundTransparency = 0
  173.                             Frame.BorderSizePixel = 0
  174.                             Frame.AnchorPoint = Vector2.new(.5, .5)
  175.                             Frame.Position = UDim2.new (0.5,0,0.5,0)
  176.                             Frame.Size = UDim2.new (1,0,1,0)
  177.                             Frame.Rotation = 0
  178.                             plr.Character.Humanoid.Died:Connect(function()
  179.                                 bill:Destroy()
  180.                             end)
  181.                         end
  182.                     end
  183.                 else
  184.                     local e = espforlder:FindFirstChild(plr.Name)
  185.                     if not e then
  186.                         --print("Added esp")
  187.                         local bill = Instance.new("BillboardGui", espforlder)
  188.                         bill.Name = plr.Name
  189.                         bill.AlwaysOnTop = true
  190.                         bill.Size = UDim2.new(1,0,1,0)
  191.                         bill.Adornee = plr.Character.Head
  192.                         local Frame = Instance.new('Frame',bill)
  193.                         Frame.Active = true
  194.                         Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  195.                         Frame.BackgroundTransparency = 0
  196.                         Frame.BorderSizePixel = 0
  197.                         Frame.AnchorPoint = Vector2.new(.5, .5)
  198.                         Frame.Position = UDim2.new (0.5,0,0.5,0)
  199.                         Frame.Size = UDim2.new (1,0,1,0)
  200.                         Frame.Rotation = 0
  201.                         plr.Character.Humanoid.Died:Connect(function()
  202.                             bill:Destroy()
  203.                         end)
  204.                     end
  205.                 end
  206.                
  207.                
  208.             end
  209.         end
  210.     end
  211.     local cam = game.Workspace.CurrentCamera
  212.    
  213.     local mouse = lplr:GetMouse()
  214.     local switch = false
  215.     local key = "k"
  216.     local aimatpart = nil
  217.     mouse.KeyDown:Connect(function(a)
  218.         if a == "t" then
  219.             print("worked1")
  220.             f.addesp()
  221.         elseif a == "u" then
  222.             if raycast == true then
  223.                 raycast = false
  224.             else
  225.                 raycast = true
  226.             end
  227.         elseif a == "l" then
  228.             if autoesp == false then
  229.                 autoesp = true
  230.             else
  231.                 autoesp = false
  232.             end
  233.         end
  234.         if a == "j" then
  235.             if mouse.Target then
  236.                 mouse.Target:Destroy()
  237.             end
  238.         end
  239.         if a == key then
  240.             if switch == false then
  241.                 switch = true
  242.             else
  243.                 switch = false
  244.                 if aimatpart ~= nil then
  245.                     aimatpart = nil
  246.                 end
  247.             end
  248.         elseif a == teambasedswitch then
  249.             if TeamBased == true then
  250.                 TeamBased = false
  251.                 teambasedstatus.Text = tostring(TeamBased)
  252.             else
  253.                 TeamBased = true
  254.                 teambasedstatus.Text = tostring(TeamBased)
  255.             end
  256.         elseif a == aimkey then
  257.             if not aimatpart then
  258.                 local maxangle = math.rad(20)
  259.                 for i, plr in pairs(plrs:GetChildren()) do
  260.                     if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  261.                         if TeamBased == true then
  262.                             if plr.Team.Name ~= lplr.Team.Name then
  263.                                 local an = checkfov(plr.Character.Head)
  264.                                 if an < maxangle then
  265.                                     maxangle = an
  266.                                     aimatpart = plr.Character.Head
  267.                                 end
  268.                             end
  269.                         else
  270.                             local an = checkfov(plr.Character.Head)
  271.                                 if an < maxangle then
  272.                                     maxangle = an
  273.                                     aimatpart = plr.Character.Head
  274.                                 end
  275.                                 print(plr)
  276.                         end
  277.                         plr.Character.Humanoid.Died:Connect(function()
  278.                             if aimatpart.Parent == plr.Character or aimatpart == nil then
  279.                                 aimatpart = nil
  280.                             end
  281.                         end)
  282.                     end
  283.                 end
  284.             else
  285.                 aimatpart = nil
  286.             end
  287.         end
  288.     end)
  289.    
  290.     function getfovxyz (p0, p1, deg)
  291.         local x1, y1, z1 = p0:ToOrientation()
  292.         local cf = CFrame.new(p0.p, p1.p)
  293.         local x2, y2, z2 = cf:ToOrientation()
  294.         --local d = math.deg
  295.         if deg then
  296.             --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  297.         else
  298.             return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  299.         end
  300.     end
  301.    
  302.     function getaimbotplrs()
  303.         plrsforaim = {}
  304.         for i, plr in pairs(plrs:GetChildren()) do
  305.             if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
  306.                
  307.                 if TeamBased == true then
  308.                     if plr.Team.Name ~= lplr.Team.Name then
  309.                         local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  310.                         local r = Ray.new(cf, cf.LookVector * 10000)
  311.                         local ign = {}
  312.                         for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  313.                             if v:IsA("BasePart") then
  314.                                 table.insert(ign , v)
  315.                             end
  316.                         end
  317.                         local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  318.                         if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  319.                             table.insert(plrsforaim, obj)
  320.                         end
  321.                     end
  322.                 else
  323.                     local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  324.                     local r = Ray.new(cf, cf.LookVector * 10000)
  325.                     local ign = {}
  326.                     for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  327.                         if v:IsA("BasePart") then
  328.                             table.insert(ign , v)
  329.                         end
  330.                     end
  331.                     local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  332.                     if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  333.                         table.insert(plrsforaim, obj)
  334.                     end
  335.                 end
  336.                
  337.                
  338.             end
  339.         end
  340.     end
  341.    
  342.     function aimat(part)
  343.         cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  344.     end
  345.     function checkfov (part)
  346.         local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  347.         local angle = math.abs(fov.X) + math.abs(fov.Y)
  348.         return angle
  349.     end
  350.    
  351.     game:GetService("RunService").RenderStepped:Connect(function()
  352.         if aimatpart then
  353.             aimat(aimatpart)
  354.             if aimatpart.Parent == plrs.LocalPlayer.Character then
  355.                 aimatpart = nil
  356.             end
  357.         end
  358.        
  359.        
  360.     --  if switch == true then
  361.     --      local maxangle = 99999
  362.     --     
  363.     --      --print("Loop")
  364.     --      if true and raycast == false then
  365.     --          for i, plr in pairs(plrs:GetChildren()) do
  366.     --              if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  367.     --                  if TeamBased then
  368.     --                      if plr.Team.Name ~= lplr.Team.Name or plr.Team.TeamColor ~= lplr.Team.TeamColor then
  369.     --                          local an = checkfov(plr.Character.Head)
  370.     --                          if an < maxangle then
  371.     --                              maxangle = an
  372.     --                              aimatpart = plr.Character.Head
  373.     --                              if an < lockangle then
  374.     --                                  break
  375.     --                              end
  376.     --                          end
  377.     --                      end
  378.     --                  else
  379.     --                      local an = checkfov(plr.Character.Head)
  380.     --                          if an < maxangle then
  381.     --                              maxangle = an
  382.     --                              aimatpart = plr.Character.Head
  383.     --                              if an < lockangle then
  384.     --                                  break
  385.     --                              end
  386.     --                          end
  387.     --                  end
  388.     --                 
  389.     --                 
  390.     --                 
  391.     --                 
  392.     --              end
  393.     --          end
  394.     --      elseif raycast == true then
  395.     --         
  396.     --      end
  397.            
  398.             if raycast == true and switch == false and not aimatpart then
  399.                 getaimbotplrs()
  400.                 aimatpart = nil
  401.                 local maxangle = 999
  402.                 for i, v in ipairs(plrsforaim) do
  403.                     if v.Parent ~= lplr.Character then
  404.                         local an = checkfov(v)
  405.                         if an < maxangle and v ~= lplr.Character.Head then
  406.                             maxangle = an
  407.                             aimatpart = v
  408.                             print(v:GetFullName())
  409.                             v.Parent.Humanoid.Died:connect(function()
  410.                                 aimatpart = nil
  411.                             end)
  412.                         end
  413.                     end
  414.                 end
  415.            
  416.         end
  417.     end)
  418.     delay(0, function()
  419.         while wait(espupdatetime) do
  420.             if autoesp == true then
  421.                 pcall(function()
  422.                 f.addesp()
  423.                 end)
  424.             end
  425.         end
  426.     end)
  427.     warn("loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement