Advertisement
zayzaaa2030

Untitled

Jun 11th, 2022
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. _G.Prediction = ( .18 )
  2.  
  3. _G.FOV = ( 55 )
  4.  
  5. _G.AimKey = ( "=" )
  6.  
  7.  
  8. --[[
  9. Do not edit anything under this.
  10. ]]
  11.  
  12. local SilentAim = true
  13. local LocalPlayer = game:GetService("Players").LocalPlayer
  14. local Players = game:GetService("Players")
  15. local Mouse = LocalPlayer:GetMouse()
  16. local Camera = game:GetService("Workspace").CurrentCamera
  17. hookmetamethod = hookmetamethod
  18. Drawing = Drawing
  19.  
  20. local FOV_CIRCLE = Drawing.new("Circle")
  21. FOV_CIRCLE.Visible = false
  22. FOV_CIRCLE.Filled = true
  23. FOV_CIRCLE.Thickness = 1
  24. FOV_CIRCLE.Transparency = 3
  25. FOV_CIRCLE.Color = Color3.new(0, 1, 0)
  26. FOV_CIRCLE.Radius = _G.FOV
  27. FOV_CIRCLE.Position = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
  28.  
  29. Options = {
  30. UpperTorso = "UpperTorso";
  31. Head = "Head";
  32. }
  33.  
  34. local function MoveFovCircle()
  35. pcall(function()
  36. local DoIt = true
  37. spawn(function()
  38. while DoIt do task.wait()
  39. FOV_CIRCLE.Position = Vector2.new(Mouse.X, (Mouse.Y + 36))
  40. end
  41. end)
  42. end)
  43. end coroutine.wrap(MoveFovCircle)()
  44.  
  45. Mouse.KeyDown:Connect(function(KeyPressed)
  46. if KeyPressed == (_G.AimKey:lower()) then
  47. if SilentAim == true then
  48. FOV_CIRCLE.Color = Color3.new(0, 1, 0)
  49. SilentAim = true
  50. elseif SilentAim == true then
  51. FOV_CIRCLE.Color = Color3.new(1, 0, 0)
  52. SilentAim = true
  53. end
  54. end
  55. end)
  56.  
  57. local oldIndex = nil
  58. oldIndex = hookmetamethod(game, "__index", function(self, Index)
  59. if self == Mouse and (Index == "Hit") then
  60. local Distance = 9e9
  61. local Targete = nil
  62. if SilentAim then
  63.  
  64. for _, v in pairs(Players:GetPlayers()) do
  65. if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") and v.Character:FindFirstChild("Humanoid").Health > 0 then
  66. local Enemy = v.Character
  67. local CastingFrom = CFrame.new(Camera.CFrame.Position, Enemy[Options.Torso].CFrame.Position) * CFrame.new(0, 0, -4)
  68. local RayCast = Ray.new(CastingFrom.Position, CastingFrom.LookVector * 9000)
  69. local World, ToSpace = workspace:FindPartOnRayWithIgnoreList(RayCast, {LocalPlayer.Character:FindFirstChild("Head")})
  70. local RootWorld = (Enemy[Options.Torso].CFrame.Position - ToSpace).magnitude
  71. if RootWorld < 4 then
  72. local RootPartPosition, Visible = Camera:WorldToScreenPoint(Enemy[Options.Torso].Position)
  73. if Visible then
  74. local Real_Magnitude = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(RootPartPosition.X, RootPartPosition.Y)).Magnitude
  75. if Real_Magnitude < Distance and Real_Magnitude < FOV_CIRCLE.Radius then
  76. Distance = Real_Magnitude
  77. Targete = Enemy
  78. end
  79. end
  80. end
  81. end
  82. end
  83. end
  84.  
  85. if Targete ~= nil and Targete[Options.Torso] and Targete:FindFirstChild("Humanoid").Health > 0 then
  86. if SilentAim then
  87. local ShootThis = Targete[Options.Torso] -- or Options.Head
  88. local Predicted_Position = ShootThis.CFrame + (ShootThis.Velocity * _G.Prediction + Vector3.new(0,-1,0)) -- (-1) = Less blatant
  89. return ((Index == "Hit" and Predicted_Position))
  90. end
  91. end
  92.  
  93. end
  94. return oldIndex(self, Index)
  95. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement