Advertisement
AbsiTheNoob

Roblox Kat Script (Knife Silent Aim)

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