HD_G4M3R

asdafgewgfwetewtwere

Apr 14th, 2021 (edited)
238
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. getgenv().AimPart = "HumanoidRootPart" -- For R15 Games: {UpperTorso, LowerTorso, HumanoidRootPart, Head} | For R6 Games: {Head, Torso, HumanoidRootPart}
  3. getgenv().AimlockToggleKey = "Y" -- Toggles Aimbot On/Off
  4. getgenv().AimRadius = 50 -- How far away from someones character you want to lock on at
  5. getgenv().ThirdPerson = false -- Locking onto someone in your Third Person POV
  6. getgenv().FirstPerson = true -- Locking onto someone in your First Person POV
  7. getgenv().TeamCheck = false -- Check if Target is on your Team (True means it wont lock onto your teamates, false is vice versa) (Set it to false if there are no teams)
  8. getgenv().PredictMovement = true -- Predicts if they are moving in fast velocity (like jumping) so the aimbot will go a bit faster to match their speed
  9. getgenv().PredictionVelocity = 10 -- The speed of the PredictMovement feature
  10. ]]--
  11.  
  12. getgenv().CiazwareUniversalAimbotLoadingTime = tick()
  13. if CiazwareUniversalAimbotLoaded == true then
  14.     Notify("Ciazware", "Script Loaded Already", "", 3)
  15.     return
  16. end
  17.  
  18. local Players, Uis, RService, SGui = game:GetService"Players", game:GetService"UserInputService", game:GetService"RunService", game:GetService"StarterGui";
  19. local Client, Mouse, Camera, CF, RNew, Vec3, Vec2 = Players.LocalPlayer, Players.LocalPlayer:GetMouse(), workspace.CurrentCamera, CFrame.new, Ray.new, Vector3.new, Vector2.new;
  20. local Aimlock, MousePressed, CanNotify = true, false, false;
  21. local AimlockTarget;
  22. getgenv().CiazwareUniversalAimbotLoaded = true
  23.  
  24. getgenv().SeparateNotify = function(title, text, icon, time)
  25.     SGui:SetCore("SendNotification",{
  26.         Title = title;
  27.         Text = text;
  28.         Icon = "rbxassetid://5793181157";
  29.         Duration = time;
  30.     })
  31. end
  32.  
  33. getgenv().Notify = function(title, text, icon, time)
  34.     if CanNotify == true then
  35.         if not time or not type(time) == "number" then time = 3 end
  36.         SGui:SetCore("SendNotification",{
  37.             Title = title;
  38.             Text = text;
  39.             Icon = "rbxassetid://5793181157";
  40.             Duration = time;
  41.         })
  42.     end
  43. end
  44.  
  45. getgenv().WorldToViewportPoint = function(P)
  46.     return Camera:WorldToViewportPoint(P)
  47. end
  48.  
  49. getgenv().WorldToScreenPoint = function(P)
  50.     return Camera.WorldToScreenPoint(Camera, P)
  51. end
  52.  
  53. getgenv().GetObscuringObjects = function(T)
  54.     if T and T:FindFirstChild(getgenv().AimPart) and Client and Client.Character:FindFirstChild("Head") then
  55.         local RayPos = workspace:FindPartOnRay(RNew(
  56.             T[getgenv().AimPart].Position, Client.Character.Head.Position)
  57.         )
  58.         if RayPos then return RayPos:IsDescendantOf(T) end
  59.     end
  60. end
  61.  
  62. getgenv().GetNearestTarget = function()
  63.     -- Credits to whoever made this, i didnt make it, and my own mouse2plr function kinda sucks
  64.     local players = {}
  65.     local PLAYER_HOLD  = {}
  66.     local DISTANCES = {}
  67.     for i, v in pairs(Players:GetPlayers()) do
  68.         if v ~= Client then
  69.             table.insert(players, v)
  70.         end
  71.     end
  72.     for i, v in pairs(players) do
  73.         if v.Character ~= nil then
  74.             local AIM = v.Character:FindFirstChild("Head")
  75.             if getgenv().TeamCheck == true and v.Team ~= Client.Team then
  76.                 local DISTANCE = (v.Character:FindFirstChild("Head").Position - game.Workspace.CurrentCamera.CFrame.p).magnitude
  77.                 local RAY = Ray.new(game.Workspace.CurrentCamera.CFrame.p, (Mouse.Hit.p - game.Workspace.CurrentCamera.CFrame.p).unit * DISTANCE)
  78.                 local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  79.                 local DIFF = math.floor((POS - AIM.Position).magnitude)
  80.                 PLAYER_HOLD[v.Name .. i] = {}
  81.                 PLAYER_HOLD[v.Name .. i].dist= DISTANCE
  82.                 PLAYER_HOLD[v.Name .. i].plr = v
  83.                 PLAYER_HOLD[v.Name .. i].diff = DIFF
  84.                 table.insert(DISTANCES, DIFF)
  85.             elseif getgenv().TeamCheck == false and v.Team == Client.Team then
  86.                 local DISTANCE = (v.Character:FindFirstChild("Head").Position - game.Workspace.CurrentCamera.CFrame.p).magnitude
  87.                 local RAY = Ray.new(game.Workspace.CurrentCamera.CFrame.p, (Mouse.Hit.p - game.Workspace.CurrentCamera.CFrame.p).unit * DISTANCE)
  88.                 local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  89.                 local DIFF = math.floor((POS - AIM.Position).magnitude)
  90.                 PLAYER_HOLD[v.Name .. i] = {}
  91.                 PLAYER_HOLD[v.Name .. i].dist= DISTANCE
  92.                 PLAYER_HOLD[v.Name .. i].plr = v
  93.                 PLAYER_HOLD[v.Name .. i].diff = DIFF
  94.                 table.insert(DISTANCES, DIFF)
  95.             end
  96.         end
  97.     end
  98.    
  99.     if unpack(DISTANCES) == nil then
  100.         return nil
  101.     end
  102.    
  103.     local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  104.     if L_DISTANCE > getgenv().AimRadius then
  105.         return nil
  106.     end
  107.    
  108.     for i, v in pairs(PLAYER_HOLD) do
  109.         if v.diff == L_DISTANCE then
  110.             return v.plr
  111.         end
  112.     end
  113.     return nil
  114. end
  115.  
  116. getgenv().CheckTeamsChildren = function()
  117.     if workspace and workspace:FindFirstChild"Teams" then
  118.         if getgenv().TeamCheck == true then
  119.             if #workspace.Teams:GetChildren() == 0 then
  120.                 getgenv().TeamCheck = false
  121.                 SeparateNotify("Ciazware", "TeamCheck set to: "..tostring(getgenv().TeamCheck).." because there are no teams!", "", 3)
  122.             end
  123.         end
  124.     end
  125. end
  126. CheckTeamsChildren()
  127.  
  128. getgenv().GetNearestTarget = function()
  129.     local T;
  130.     for _, p in next, Players:GetPlayers() do
  131.         if p ~= Client then
  132.             if p.Character and p.Character:FindFirstChild(getgenv().AimPart) then
  133.                 if getgenv().TeamCheck == true and p.Team ~= Client.Team then
  134.                     local Pos, ScreenCheck = WorldToScreenPoint(p.Character[getgenv().AimPart].Position)
  135.                     Pos = Vec2(Pos.X, Pos.Y)
  136.                     local MPos = Vec2(Mouse.X, Mouse.Y) -- Credits to CriShoux for this
  137.                     local Distance = (Pos - MPos).Magnitude;
  138.                     if Distance < getgenv().AimRadius then
  139.                         T = p
  140.                     end
  141.                 elseif getgenv().TeamCheck == false and p.Team == Client.Team then
  142.                     local Pos, ScreenCheck = WorldToScreenPoint(p.Character[getgenv().AimPart].Position)
  143.                     Pos = Vec2(Pos.X, Pos.Y)
  144.                     local MPos = Vec2(Mouse.X, Mouse.Y) -- Credits to CriShoux for this
  145.                     local Distance = (Pos - MPos).Magnitude;
  146.                     if Distance < getgenv().AimRadius then
  147.                         T = p
  148.                     end
  149.                 end
  150.             end
  151.         end
  152.     end
  153.     if T then
  154.         return T
  155.     end
  156. end
  157.  
  158. Uis.InputBegan:Connect(function(Key)
  159.     if not (Uis:GetFocusedTextBox()) then
  160.         if Key.UserInputType == Enum.UserInputType.MouseButton2 then
  161.             pcall(function()
  162.                 if MousePressed ~= true then MousePressed = true end
  163.                 local Target;Target = GetNearestTarget()
  164.                 if Target ~= nil then
  165.                     AimlockTarget = Target
  166.                     Notify("Ciazware", "Aimlock Target: "..tostring(AimlockTarget), "", 3)
  167.                 end
  168.             end)
  169.         end
  170.         if Key.KeyCode == Enum.KeyCode[AimlockToggleKey] then
  171.             Aimlock = not Aimlock
  172.             Notify("Ciazware", "Aimlock: "..tostring(Aimlock), "", 3)
  173.         end
  174.     end
  175. end)
  176. Uis.InputEnded:Connect(function(Key)
  177.     if not (Uis:GetFocusedTextBox()) then
  178.         if Key.UserInputType == Enum.UserInputType.MouseButton2 then
  179.             if AimlockTarget ~= nil then AimlockTarget = nil end
  180.             if MousePressed ~= false then
  181.                 MousePressed = false
  182.             end
  183.         end
  184.     end
  185. end)
  186.  
  187. RService.RenderStepped:Connect(function()
  188.     if getgenv().FirstPerson == true and getgenv().ThirdPerson == false then
  189.         if (Camera.Focus.p - Camera.CoordinateFrame.p).Magnitude <= 1 then
  190.             CanNotify = true
  191.         else
  192.             CanNotify = false
  193.         end
  194.     elseif getgenv().ThirdPerson == true and getgenv().FirstPerson == false then
  195.         if (Camera.Focus.p - Camera.CoordinateFrame.p).Magnitude > 1 then
  196.             CanNotify = true
  197.         else
  198.             CanNotify = false
  199.         end
  200.     end
  201.     if Aimlock == true and MousePressed == true then
  202.         if AimlockTarget and AimlockTarget.Character and AimlockTarget.Character:FindFirstChild(getgenv().AimPart) then
  203.             if getgenv().FirstPerson == true then
  204.                 if CanNotify == true then
  205.                     if getgenv().PredictMovement == true then
  206.                         Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position + AimlockTarget.Character[getgenv().AimPart].Velocity/PredictionVelocity)
  207.                     elseif getgenv().PredictMovement == false then
  208.                         Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position)
  209.                     end
  210.                 end
  211.             elseif getgenv().ThirdPerson == true then
  212.                 if CanNotify == true then
  213.                     if getgenv().PredictMovement == true then
  214.                         Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position + AimlockTarget.Character[getgenv().AimPart].Velocity/PredictionVelocity)
  215.                     elseif getgenv().PredictMovement == false then
  216.                         Camera.CFrame = CF(Camera.CFrame.p, AimlockTarget.Character[getgenv().AimPart].Position)
  217.                     end
  218.                 end
  219.             end
  220.         end
  221.     end
  222. end)
  223.  
  224. SeparateNotify("Ciazware", "Universal Aimbot loaded in: "..string.format("%.7f", tostring(tick() - CiazwareUniversalAimbotLoadingTime)), "", 3)
RAW Paste Data