Advertisement
Guest User

OP SILENT AIM HOOD CUSTOMS

a guest
Jun 26th, 2022
11,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. --[[
  2. ███████╗██╗░░░░░░█████╗░░██████╗██╗░░██╗░██╗░░░░░░░██╗
  3. ██╔════╝██║░░░░░██╔══██╗██╔════╝██║░░██║░██║░░██╗░░██║
  4. █████╗░░██║░░░░░███████║╚█████╗░███████║░╚██╗████╗██╔╝
  5. ██╔══╝░░██║░░░░░██╔══██║░╚═══██╗██╔══██║░░████╔═████║░
  6. ██║░░░░░███████╗██║░░██║██████╔╝██║░░██║░░╚██╔╝░╚██╔╝░
  7. ╚═╝░░░░░╚══════╝╚═╝░░╚═╝╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░
  8.  
  9. ]]
  10. getgenv().Key = Enum.KeyCode.Q
  11. getgenv().Prediction = 0.1337
  12. getgenv().Partz = "LowerTorso" -- LowerTorso, HumanoidRootPart,Head,UpperTorso
  13.  
  14.  
  15. local Locking = false
  16. local Draw = Drawing.new
  17. local Square = Drawing.new("Square")
  18. Square.Visible = false
  19. Square.Color = Color3.fromRGB(30, 168, 145)
  20. Square.Thickness = 20
  21. Square.Size = Vector2.new(20,20)
  22. Square.Filled = true
  23.  
  24. game:GetService("UserInputService").InputBegan:Connect(function(keygo,ok)
  25. if (not ok) then
  26. if (keygo.KeyCode == getgenv().Key) then
  27. Locking = not Locking
  28. if Locking then
  29. Plr = getClosestPlayerToCursor()
  30. elseif not Locking then
  31.  
  32.  
  33.  
  34. end
  35. end
  36. end
  37. end)
  38. function getClosestPlayerToCursor()
  39. local closestPlayer
  40. local shortestDistance = math.huge
  41.  
  42. for i, v in pairs(game.Players:GetPlayers()) do
  43. if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("LowerTorso") then
  44. local pos = game:GetService"Workspace".CurrentCamera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  45. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new( game.Players.LocalPlayer:GetMouse().X, game.Players.LocalPlayer:GetMouse().Y)).magnitude
  46. if magnitude < shortestDistance then
  47. closestPlayer = v
  48. shortestDistance = magnitude
  49. end
  50. end
  51. end
  52. return closestPlayer
  53. end
  54.  
  55. local rawmetatable = getrawmetatable(game)
  56. local old = rawmetatable.__namecall
  57. setreadonly(rawmetatable, false)
  58. rawmetatable.__namecall = newcclosure(function(...)
  59. local args = {...}
  60. if Locking and getnamecallmethod() == "FireServer" and args[2] == "GetMousePos" then
  61. args[3] = Plr.Character[getgenv().Partz].Position+(Plr.Character[getgenv().Partz].Velocity*Prediction)
  62. return old(unpack(args))
  63. end
  64. return old(...)
  65. end)
  66.  
  67.  
  68. game.RunService.Stepped:Connect(function()
  69. if Plr ~= nil and Locking then
  70. local Vector, OnScreen = workspace.CurrentCamera:worldToViewportPoint(Plr.Character[getgenv().Partz].Position+(Plr.Character[getgenv().Partz].Velocity*Prediction))
  71. if OnScreen then
  72. Square.Visible = true
  73. Square.Position = Vector2.new(Vector.X,Vector.Y)
  74. end
  75. elseif not Locking then
  76. Square.Visible = false
  77. end
  78.  
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement