yeoyeoyeoyayaya

Untitled

Feb 27th, 2023
666
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. --[[
  2. Assassin Silent Aim.lua
  3. Made by Rileyy#0808
  4. ]]
  5.  
  6. --// Variables
  7. local Players = game:GetService('Players')
  8. local RunService = game:GetService('RunService')
  9. local UserInputService = game:GetService('UserInputService')
  10.  
  11. local LocalPlayer = Players.LocalPlayer
  12. local Mouse = LocalPlayer:GetMouse()
  13. local CurrentCamera = workspace.CurrentCamera
  14.  
  15. --// Tables
  16. local Client = {}
  17. local Drawings = {
  18. Drawing.new('Circle'),
  19. Drawing.new('Circle')
  20. }
  21.  
  22. --// FOV
  23. Drawings[1].Color = Color3.fromRGB(248, 200, 220)
  24. Drawings[1].Thickness = 2
  25. Drawings[1].Visible = true
  26. Drawings[1].Radius = 150
  27.  
  28. Drawings[2].Thickness = 4
  29. Drawings[2].Visible = true
  30. Drawings[2].Radius = 150
  31. Drawings[2].ZIndex = -1
  32.  
  33. UserInputService.InputChanged:Connect(function(input)
  34. if input.UserInputType == Enum.UserInputType.MouseMovement then
  35. Drawings[1].Position = UserInputService:GetMouseLocation()
  36. Drawings[2].Position = UserInputService:GetMouseLocation()
  37. end
  38. end)
  39.  
  40. --// Functions
  41. function IsVisible(position, model)
  42. local ray = Ray.new(CurrentCamera.CFrame.p, CFrame.new(CurrentCamera.CFrame.p, position).LookVector * 10000)
  43. local hit, position, normal = workspace:FindPartOnRayWithIgnoreList(ray, {LocalPlayer.Character, CurrentCamera})
  44. if not hit then
  45. return false
  46. end
  47. return hit:IsDescendantOf(model), hit, position, normal
  48. end
  49.  
  50. --// Loops
  51.  
  52. RunService.PostSimulation:Connect(function()
  53. local MousePosition = UserInputService:GetMouseLocation()
  54. Client.Target = nil
  55. Client.TargetDistance = Drawings[1].Radius
  56.  
  57. for _, player in next, Players:GetChildren() do
  58.  
  59. local character = workspace:FindFirstChild(player.Name)
  60. local Humanoid = character and character:FindFirstChildWhichIsA('Humanoid')
  61. local HumanoidRootPart = character and character:FindFirstChild('HumanoidRootPart')
  62.  
  63. if not Humanoid or not HumanoidRootPart then
  64. continue
  65. end
  66.  
  67. if Humanoid.Health <= 0 then
  68. continue
  69. end
  70.  
  71. -- if not IsVisible(HumanoidRootPart.Position, player.Character) then
  72. -- continue
  73. -- end
  74.  
  75. local ScreenPosition, ScreenVisible = CurrentCamera:WorldToViewportPoint(HumanoidRootPart.Position)
  76. local MouseDistance = (MousePosition - Vector2.new(ScreenPosition.X, ScreenPosition.Y)).magnitude
  77.  
  78. if MouseDistance < Client.TargetDistance then
  79. Client.Target = character
  80. Client.TargetDistance = MouseDistance
  81. end
  82. end
  83. end)
  84.  
  85. --// Hooks
  86.  
  87. local index ; index = hookmetamethod(game, '__index', function(obj, idx)
  88.  
  89. if idx:lower() == 'unitray' and Client.Target then
  90. local origin = index(obj, idx)
  91. return {
  92. Origin = origin.Origin,
  93. Direction = CFrame.new(origin.Origin, Client.Target.HumanoidRootPart.Position).LookVector
  94. }
  95. end
  96.  
  97. return index(obj, idx)
  98. end)
  99.  
  100. --// Notify :3
  101. game.StarterGui:SetCore('SendNotification', {
  102. Title = 'Loaded';
  103. Text = 'Made by Rileyy#0808';
  104. Duration = 3;
  105. })
Comments
Add Comment
Please, Sign In to add comment