Advertisement
anonmods

KAT-Silent aim

Feb 6th, 2022
7,638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. --BROUGHT TO YOU BY RSCRIPTS.NET!--
  2.  
  3. getgenv().silentaim_settings = {
  4. fov = 150,
  5. hitbox = "Head",
  6. fovcircle = true,
  7. }
  8. -- Services
  9. local Players = game:GetService("Players")
  10. local RunService = game:GetService("RunService")
  11.  
  12. -- Player
  13. local Player = Players.LocalPlayer
  14. local Mouse = Player:GetMouse()
  15. local CurrentCamera = workspace.CurrentCamera
  16.  
  17. local function GetClosest(Fov)
  18. local Target, Closest = nil, Fov or math.huge
  19.  
  20. for i,v in pairs(Players:GetPlayers()) do
  21. if (v.Character and v ~= Player and v.Character:FindFirstChild(getgenv().silentaim_settings.hitbox)) then
  22. local Position, OnScreen = CurrentCamera:WorldToScreenPoint(v.Character[getgenv().silentaim_settings.hitbox].Position)
  23. local Distance = (Vector2.new(Position.X, Position.Y) - Vector2.new(Mouse.X, Mouse.Y)).Magnitude
  24.  
  25. if (Distance < Closest and OnScreen) then
  26. Closest = Distance
  27. Target = v
  28. end
  29. end
  30. end
  31.  
  32. return Target
  33. end
  34.  
  35. local Target
  36. local CircleInline = Drawing.new("Circle")
  37. local CircleOutline = Drawing.new("Circle")
  38. RunService.Stepped:Connect(function()
  39. CircleInline.Radius = getgenv().silentaim_settings.fov
  40. CircleInline.Thickness = 2
  41. CircleInline.Position = Vector2.new(Mouse.X, Mouse.Y + 36)
  42. CircleInline.Transparency = 1
  43. CircleInline.Color = Color3.fromRGB(255, 255, 255)
  44. CircleInline.Visible = getgenv().silentaim_settings.fovcircle
  45. CircleInline.ZIndex = 2
  46.  
  47. CircleOutline.Radius = getgenv().silentaim_settings.fov
  48. CircleOutline.Thickness = 4
  49. CircleOutline.Position = Vector2.new(Mouse.X, Mouse.Y + 36)
  50. CircleOutline.Transparency = 1
  51. CircleOutline.Color = Color3.new()
  52. CircleOutline.Visible = getgenv().silentaim_settings.fovcircle
  53. CircleOutline.ZIndex = 1
  54.  
  55. Target = GetClosest(getgenv().silentaim_settings.fov)
  56. end)
  57.  
  58. local Old; Old = hookmetamethod(game, "__namecall", function(Self, ...)
  59. local Args = {...}
  60.  
  61. if (not checkcaller() and getnamecallmethod() == "FindPartOnRayWithIgnoreList") then
  62. if (table.find(Args[2], workspace.WorldIgnore.Ignore) and Target and Target.Character) then
  63. local Origin = Args[1].Origin
  64.  
  65. Args[1] = Ray.new(Origin, Target.Character[getgenv().silentaim_settings.hitbox].Position - Origin)
  66. end
  67. end
  68.  
  69. return Old(Self, unpack(Args))
  70. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement