anonmods

BB-Full

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