SkitExploits

Roblox - E Aimlock

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