Advertisement
SINXSA

aaaa

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