Advertisement
SigmaBoy456

Roblox Advanced Aimbot v2 [OP]

Jul 12th, 2024
4,132
-1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.79 KB | None | 0 1
  1. local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
  2. local Window = OrionLib:MakeWindow({Name = "Universal Aimlock GUI v2", HidePremium = false, SaveConfig = true, ConfigFolder = "OrionTest"})
  3.  
  4. -- Main Tab
  5. local Tab = Window:MakeTab({
  6.     Name = "Aimbot",
  7.     Icon = "rbxassetid://4483345998",
  8.     PremiumOnly = false
  9. })
  10.  
  11. -- Sections
  12. local AimbotSection = Tab:AddSection({
  13.     Name = "Aimbot Settings"
  14. })
  15.  
  16. local TargetSection = Tab:AddSection({
  17.     Name = "Target Settings"
  18. })
  19.  
  20. local ESPSection = Tab:AddSection({
  21.     Name = "ESP Settings"
  22. })
  23.  
  24. -- Variables
  25. local aimbotEnabled = false
  26. local aimAtPart = "HumanoidRootPart"
  27. local wallCheckEnabled = false
  28. local targetNPCs = false
  29. local teamCheckEnabled = false
  30. local headSizeEnabled = false
  31. local espEnabled = false
  32.  
  33. -- Functions
  34. local function getClosestTarget()
  35.     local Cam = workspace.CurrentCamera
  36.     local Players = game:GetService("Players")
  37.     local localPlayer = Players.LocalPlayer
  38.     local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
  39.     local localRoot = character:WaitForChild("HumanoidRootPart")
  40.     local nearestTarget = nil
  41.     local shortestDistance = math.huge
  42.  
  43.     local function checkTarget(target)
  44.         if target and target:IsA("Model") and target:FindFirstChild("Humanoid") and target:FindFirstChild(aimAtPart) then
  45.             local targetRoot = target[aimAtPart]
  46.             local distance = (targetRoot.Position - localRoot.Position).Magnitude
  47.  
  48.             if distance < shortestDistance then
  49.                 if wallCheckEnabled then
  50.                     local rayDirection = (targetRoot.Position - Cam.CFrame.Position).Unit * 1000
  51.                     local raycastParams = RaycastParams.new()
  52.                     raycastParams.FilterDescendantsInstances = {character}
  53.                     raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  54.  
  55.                     local raycastResult = workspace:Raycast(Cam.CFrame.Position, rayDirection, raycastParams)
  56.  
  57.                     if raycastResult and raycastResult.Instance:IsDescendantOf(target) then
  58.                         shortestDistance = distance
  59.                         nearestTarget = target
  60.                     end
  61.                 else
  62.                     shortestDistance = distance
  63.                     nearestTarget = target
  64.                 end
  65.             end
  66.         end
  67.     end
  68.  
  69.     for _, player in pairs(Players:GetPlayers()) do
  70.         if player ~= localPlayer and (not teamCheckEnabled or player.Team ~= localPlayer.Team) then
  71.             checkTarget(player.Character)
  72.         end
  73.     end
  74.  
  75.     if targetNPCs then
  76.         for _, npc in pairs(workspace:GetDescendants()) do
  77.             checkTarget(npc)
  78.         end
  79.     end
  80.  
  81.     return nearestTarget
  82. end
  83.  
  84. local function lookAt(targetPosition)
  85.     local Cam = workspace.CurrentCamera
  86.     if targetPosition then
  87.         Cam.CFrame = CFrame.new(Cam.CFrame.Position, targetPosition)
  88.     end
  89. end
  90.  
  91. local function aimAtTarget()
  92.     local runService = game:GetService("RunService")
  93.     local connection
  94.     connection = runService.RenderStepped:Connect(function()
  95.         if not aimbotEnabled then
  96.             connection:Disconnect()
  97.             return
  98.         end
  99.  
  100.         local closestTarget = getClosestTarget()
  101.         if closestTarget and closestTarget:FindFirstChild(aimAtPart) then
  102.             local targetRoot = closestTarget[aimAtPart]
  103.  
  104.             while aimbotEnabled and closestTarget and closestTarget:FindFirstChild(aimAtPart) and closestTarget.Humanoid.Health > 0 do
  105.                 lookAt(targetRoot.Position)
  106.                 local rayDirection = (targetRoot.Position - workspace.CurrentCamera.CFrame.Position).Unit * 1000
  107.                 local raycastParams = RaycastParams.new()
  108.                 raycastParams.FilterDescendantsInstances = {character}
  109.                 raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  110.  
  111.                 local raycastResult = workspace:Raycast(workspace.CurrentCamera.CFrame.Position, rayDirection, raycastParams)
  112.  
  113.                 if not raycastResult or not raycastResult.Instance:IsDescendantOf(closestTarget) then
  114.                     break
  115.                 end
  116.  
  117.                 runService.RenderStepped:Wait()
  118.             end
  119.         end
  120.     end)
  121. end
  122.  
  123. local function resizeHeads()
  124.     local Players = game:GetService("Players")
  125.     local localPlayer = Players.LocalPlayer
  126.  
  127.     local function resizeHead(model)
  128.         local head = model:FindFirstChild("Head")
  129.         if head and head:IsA("BasePart") then
  130.             head.Size = Vector3.new(5, 5, 5)
  131.             head.CanCollide = false
  132.         end
  133.     end
  134.  
  135.     for _, player in pairs(Players:GetPlayers()) do
  136.         if player ~= localPlayer and player.Character then
  137.             resizeHead(player.Character)
  138.         end
  139.     end
  140.  
  141.     for _, npc in pairs(workspace:GetDescendants()) do
  142.         if npc:IsA("Model") and npc:FindFirstChild("Head") then
  143.             resizeHead(npc)
  144.         end
  145.     end
  146. end
  147.  
  148. local function createESP()
  149.     for _, player in pairs(game:GetService("Players"):GetPlayers()) do
  150.         if player ~= game.Players.LocalPlayer and player.Character and player.Character:FindFirstChild("Head") then
  151.             local head = player.Character.Head
  152.             local billboard = Instance.new("BillboardGui")
  153.             billboard.Adornee = head
  154.             billboard.Size = UDim2.new(0, 100, 0, 50)
  155.             billboard.StudsOffset = Vector3.new(0, 2, 0)
  156.             billboard.AlwaysOnTop = true
  157.  
  158.             local textLabel = Instance.new("TextLabel")
  159.             textLabel.Parent = billboard
  160.             textLabel.Size = UDim2.new(1, 0, 1, 0)
  161.             textLabel.Text = player.Name
  162.             textLabel.BackgroundTransparency = 1
  163.             textLabel.TextStrokeTransparency = 0
  164.             textLabel.TextScaled = true
  165.  
  166.             if player.Team then
  167.                 textLabel.TextColor3 = player.Team.TeamColor.Color
  168.             else
  169.                 textLabel.TextColor3 = Color3.new(1, 1, 1)
  170.             end
  171.  
  172.             billboard.Parent = head
  173.         end
  174.     end
  175. end
  176.  
  177. local function removeESP()
  178.     for _, player in pairs(game:GetService("Players"):GetPlayers()) do
  179.         if player.Character and player.Character:FindFirstChild("Head") then
  180.             for _, child in pairs(player.Character.Head:GetChildren()) do
  181.                 if child:IsA("BillboardGui") then
  182.                     child:Destroy()
  183.                 end
  184.             end
  185.         end
  186.     end
  187. end
  188.  
  189. -- GUI Elements
  190. Tab:AddToggle({
  191.     Name = "Enable Aimbot",
  192.     Default = false,
  193.     Callback = function(Value)
  194.         aimbotEnabled = Value
  195.         if aimbotEnabled then
  196.             aimAtTarget()
  197.         end
  198.     end
  199. })
  200.  
  201. Tab:AddButton({
  202.     Name = "Switch Aim Part",
  203.     Callback = function()
  204.         if aimAtPart == "HumanoidRootPart" then
  205.             aimAtPart = "Head"
  206.         else
  207.             aimAtPart = "HumanoidRootPart"
  208.         end
  209.         OrionLib:MakeNotification({
  210.             Name = "Aim Part",
  211.             Content = "Now aiming at: " .. aimAtPart,
  212.             Image = "rbxassetid://4483345998",
  213.             Time = 5
  214.         })
  215.     end
  216. })
  217.  
  218. Tab:AddToggle({
  219.     Name = "Enable Wall Check",
  220.     Default = false,
  221.     Callback = function(Value)
  222.         wallCheckEnabled = Value
  223.     end
  224. })
  225.  
  226. Tab:AddToggle({
  227.     Name = "Target NPCs",
  228.     Default = false,
  229.     Callback = function(Value)
  230.         targetNPCs = Value
  231.     end
  232. })
  233.  
  234. Tab:AddToggle({
  235.     Name = "Enable Team Check",
  236.     Default = false,
  237.     Callback = function(Value)
  238.         teamCheckEnabled = Value
  239.     end
  240. })
  241.  
  242. Tab:AddToggle({
  243.     Name = "Resize Heads",
  244.     Default = false,
  245.     Callback = function(Value)
  246.         headSizeEnabled = Value
  247.         if headSizeEnabled then
  248.             resizeHeads()
  249.         end
  250.     end
  251. })
  252.  
  253. Tab:AddToggle({
  254.     Name = "ESP Labels",
  255.     Default = false,
  256.     Callback = function(Value)
  257.         espEnabled = Value
  258.         if espEnabled then
  259.             createESP()
  260.         else
  261.             removeESP()
  262.         end
  263.     end
  264. })
  265.  
  266. OrionLib:Init()
  267.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement