Advertisement
CalllMePasting

KAT Silent Aim Script Pastebin

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