Advertisement
zayzaaa2030

Untitled

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