Ritual_x

DA HOOD PURPLE TRACER AIMLOCK SCRIPT (STARS USE)

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