Advertisement
Progamer12_3

Da hood op aimlock script (Lock tracer)

May 9th, 2022
12,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. --[[
  2. ████████ ██ ██ ██ ██ ███████ ██ ██ ██ ██
  3. ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
  4. ██ ███████ ██ ██ ███████ █████ ████
  5. ██ ██ ██ ██ ██ ██ ██ ██ ██
  6. ██ ██ ██ ██████ ███████ ██ ██ ██
  7. ]]
  8. local Settings = {
  9. AimLock = {
  10. Enabled = true,
  11. Aimlockkey = "q",
  12. Prediction = 0.135,
  13. Aimpart = 'HumanoidRootPart',
  14. Notifications = false
  15. },
  16. Settings = {
  17. Thickness = 3.5,
  18. Transparency = 1,
  19. Color = Color3.fromRGB(153, 50, 204),
  20. FOV = true
  21. }
  22.  
  23. }
  24.  
  25. local CurrentCamera = game:GetService("Workspace").CurrentCamera
  26. local Inset = game:GetService("GuiService"):GetGuiInset().Y
  27. local RunService = game:GetService("RunService")
  28.  
  29. local Mouse = game.Players.LocalPlayer:GetMouse()
  30. local LocalPlayer = game.Players.LocalPlayer
  31.  
  32. local Line = Drawing.new("Line")
  33. local Circle = Drawing.new("Circle")
  34.  
  35. local Plr
  36.  
  37. Mouse.KeyDown:Connect(function(KeyPressed)
  38. if KeyPressed == (Settings.AimLock.Aimlockkey) then
  39. if Settings.AimLock.Enabled == true then
  40. Settings.AimLock.Enabled = false
  41. if Settings.AimLock.Notifications == true then
  42. Plr = FindClosestPlayer()
  43. game.StarterGui:SetCore("SendNotification", {
  44. Title = "Private",
  45. Text = "Unlocked"
  46. })
  47. end
  48. else
  49. Plr = FindClosestPlayer()
  50. Settings.AimLock.Enabled = true
  51. if Settings.AimLock.Notifications == true then
  52. game.StarterGui:SetCore("SendNotification", {
  53. Title = "Private",
  54. Text = "Locked On : " .. tostring(Plr.Character.Humanoid.DisplayName)
  55. })
  56. end
  57. end
  58. end
  59. end)
  60.  
  61. function FindClosestPlayer()
  62. local ClosestDistance, ClosestPlayer = math.huge, nil;
  63. for _, Player in next, game:GetService("Players"):GetPlayers() do
  64. local ISNTKNOCKED = Player.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  65. local ISNTGRABBED = Player.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  66.  
  67. if Player ~= LocalPlayer then
  68. local Character = Player.Character
  69. if Character and Character.Humanoid.Health > 1 and ISNTKNOCKED and ISNTGRABBED then
  70. local Position, IsVisibleOnViewPort = CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart
  71. .Position)
  72. if IsVisibleOnViewPort then
  73. local Distance = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(Position.X, Position.Y)).Magnitude
  74. if Distance < ClosestDistance then
  75. ClosestPlayer = Player
  76. ClosestDistance = Distance
  77. end
  78. end
  79. end
  80. end
  81. end
  82. return ClosestPlayer, ClosestDistance
  83. end
  84.  
  85. RunService.Heartbeat:connect(function()
  86. if Settings.AimLock.Enabled == true then
  87. local Vector = CurrentCamera:WorldToViewportPoint(Plr.Character[Settings.AimLock.Aimpart].Position +
  88. (Plr.Character[Settings.AimLock.Aimpart].Velocity *
  89. Settings.AimLock.Prediction))
  90. Line.Color = Settings.Settings.Color
  91. Line.Transparency = Settings.Settings .Transparency
  92. Line.Thickness = Settings.Settings .Thickness
  93. Line.From = Vector2.new(Mouse.X, Mouse.Y + Inset)
  94. Line.To = Vector2.new(Vector.X, Vector.Y)
  95. Line.Visible = true
  96. Circle.Position = Vector2.new(Mouse.X, Mouse.Y + Inset)
  97. Circle.Visible = Settings.Settings.FOV
  98. Circle.Thickness = 1.5
  99. Circle.Thickness = 2
  100. Circle.Radius = 60
  101. Circle.Color = Settings.Settings.Color
  102. elseif Settings.AimLock.FOV == true then
  103. Circle.Visible = true
  104. else
  105. Circle.Visible = false
  106. Line.Visible = false
  107. end
  108. end)
  109.  
  110. local mt = getrawmetatable(game)
  111. local old = mt.__namecall
  112. setreadonly(mt, false)
  113. mt.__namecall = newcclosure(function(...)
  114. local args = {...}
  115. if Settings.AimLock.Enabled and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
  116. args[3] = Plr.Character[Settings.AimLock.Aimpart].Position +
  117. (Plr.Character[Settings.AimLock.Aimpart].Velocity * Settings.AimLock.Prediction)
  118.  
  119. return old(unpack(args))
  120. end
  121. return old(...)
  122. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement