qqjay44

Hood Customs OP Lock (WORKS + NEW!)

Jun 12th, 2024 (edited)
13,660
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.07 KB | Gaming | 1 1
  1. -- HOOD CUSTOMS LOCK SCRIPT (WORKS + NEW!)
  2. -- Join our Discord Server for More Lock Scripts,
  3. -- More Da Hood Gui Scripts, Roblox Executors and Da hood + other Game Files!
  4. -- .gg/2mJUkQjW
  5.  
  6. -- Made BY qqjay44 on Discord
  7.  
  8. -- REMEMBER, THIS LOCK WORKS (ONLY) ON HOOD CUSTOMS.
  9.  
  10. getgenv().Prediction = 0.13
  11. getgenv().AimPart = "HumanoidRootPart"
  12. getgenv().Key = "C"
  13. getgenv().DisableKey = "P"
  14.  
  15. getgenv().FOV = true
  16. getgenv().ShowFOV = false
  17. getgenv().FOVSize = 55
  18.  
  19. --// Variables (Service)
  20.  
  21. local Players = game:GetService("Players")
  22. local RS = game:GetService("RunService")
  23. local WS = game:GetService("Workspace")
  24. local GS = game:GetService("GuiService")
  25. local SG = game:GetService("StarterGui")
  26.  
  27. --// Variables (regular)
  28.  
  29. local LP = Players.LocalPlayer
  30. local Mouse = LP:GetMouse()
  31. local Camera = WS.CurrentCamera
  32. local GetGuiInset = GS.GetGuiInset
  33.  
  34. local AimlockState = true
  35. local Locked
  36. local Victim
  37.  
  38. local SelectedKey = getgenv().Key
  39. local SelectedDisableKey = getgenv().DisableKey
  40.  
  41. --// Notification function
  42.  
  43. function Notify(tx)
  44.     SG:SetCore("SendNotification", {
  45.         Title = "Jays Hood Customs Lock",
  46.         Text = tx,
  47.         Duration = 5
  48.     })
  49. end
  50.  
  51. --// Check if aimlock is loaded
  52.  
  53. if getgenv().Loaded == true then
  54.     Notify("Aimlock is already loaded!")
  55.     return
  56. end
  57.  
  58. getgenv().Loaded = true
  59.  
  60. --// FOV Circle
  61.  
  62. local fov = Drawing.new("Circle")
  63. fov.Filled = false
  64. fov.Transparency = 1
  65. fov.Thickness = 1
  66. fov.Color = Color3.fromRGB(255, 255, 0)
  67. fov.NumSides = 1000
  68.  
  69. --// Functions
  70.  
  71. function update()
  72.     if getgenv().FOV == true then
  73.         if fov then
  74.             fov.Radius = getgenv().FOVSize * 2
  75.             fov.Visible = getgenv().ShowFOV
  76.             fov.Position = Vector2.new(Mouse.X, Mouse.Y + GetGuiInset(GS).Y)
  77.  
  78.             return fov
  79.         end
  80.     end
  81. end
  82.  
  83. function WTVP(arg)
  84.     return Camera:WorldToViewportPoint(arg)
  85. end
  86.  
  87. function WTSP(arg)
  88.     return Camera.WorldToScreenPoint(Camera, arg)
  89. end
  90.  
  91. function getClosest()
  92.     local closestPlayer
  93.     local shortestDistance = math.huge
  94.  
  95.     for i, v in pairs(game.Players:GetPlayers()) do
  96.         local notKO = v.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  97.         local notGrabbed = v.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  98.  
  99.         if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild(getgenv().AimPart) and notKO and notGrabbed then
  100.             local pos = Camera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  101.             local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
  102.  
  103.             if (getgenv().FOV) then
  104.                 if (fov.Radius > magnitude and magnitude < shortestDistance) then
  105.                     closestPlayer = v
  106.                     shortestDistance = magnitude
  107.                 end
  108.             else
  109.                 if (magnitude < shortestDistance) then
  110.                     closestPlayer = v
  111.                     shortestDistance = magnitude
  112.                 end
  113.             end
  114.         end
  115.     end
  116.     return closestPlayer
  117. end
  118.  
  119. --// Checks if key is down
  120.  
  121. Mouse.KeyDown:Connect(function(k)
  122.     SelectedKey = SelectedKey:lower()
  123.     SelectedDisableKey = SelectedDisableKey:lower()
  124.     if k == SelectedKey then
  125.         if AimlockState == true then
  126.             Locked = not Locked
  127.             if Locked then
  128.                 Victim = getClosest()
  129.  
  130.                 Notify("Locked onto: "..tostring(Victim.Character.Humanoid.DisplayName))
  131.             else
  132.                 if Victim ~= nil then
  133.                     Victim = nil
  134.  
  135.                     Notify("Unlocked!")
  136.                 end
  137.             end
  138.         else
  139.             Notify("Aimlock is not enabled!")
  140.         end
  141.     end
  142.     if k == SelectedDisableKey then
  143.         AimlockState = not AimlockState
  144.     end
  145. end)
  146.  
  147. --// Loop update FOV and loop camera lock onto target
  148.  
  149. RS.RenderStepped:Connect(function()
  150.     update()
  151.     if AimlockState == true then
  152.         if Victim ~= nil then
  153.             Camera.CFrame = CFrame.new(Camera.CFrame.p, Victim.Character[getgenv().AimPart].Position + Victim.Character[getgenv().AimPart].Velocity*getgenv().Prediction)
  154.         end
  155.     end
  156. end)
  157.     while wait() do
  158.         if getgenv().AutoPrediction == true then
  159.         local pingvalue = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString()
  160.         local split = string.split(pingvalue,'(')
  161.         local ping = tonumber(split[1])
  162.             if ping < 225 then
  163.             getgenv().Prediction = 1.4
  164.         elseif ping < 215 then
  165.             getgenv().Prediction = 1.2
  166.         elseif ping < 205 then
  167.             getgenv().Prediction = 1.0
  168.         elseif ping < 190 then
  169.             getgenv().Prediction = 0.10
  170.         elseif ping < 180 then
  171.             getgenv().Prediction = 0.12
  172.         elseif ping < 170 then
  173.             getgenv().Prediction = 0.15
  174.         elseif ping < 160 then
  175.             getgenv().Prediction = 0.18
  176.         elseif ping < 150 then
  177.             getgenv().Prediction = 0.110
  178.         elseif ping < 140 then
  179.             getgenv().Prediction = 0.113
  180.         elseif ping < 130 then
  181.             getgenv().Prediction = 0.116
  182.         elseif ping < 120 then
  183.             getgenv().Prediction = 0.120
  184.         elseif ping < 110 then
  185.             getgenv().Prediction = 0.124
  186.         elseif ping < 105 then
  187.             getgenv().Prediction = 0.127
  188.         elseif ping < 90 then
  189.             getgenv().Prediction = 0.130
  190.         elseif ping < 80 then
  191.             getgenv().Prediction = 0.133
  192.         elseif ping < 70 then
  193.             getgenv().Prediction = 0.136
  194.         elseif ping < 60 then
  195.             getgenv().Prediction = 0.15038
  196.         elseif ping < 50 then
  197.             getgenv().Prediction = 0.15038
  198.         elseif ping < 40 then
  199.             getgenv().Prediction = 0.145
  200.         elseif ping < 30 then
  201.             getgenv().Prediction = 0.155
  202.         elseif ping < 20 then
  203.             getgenv().Prediction = 0.157
  204.         end
  205.         end
  206.     end
Advertisement
Comments
Add Comment
Please, Sign In to add comment