Advertisement
Guest User

Assassin Silent Aim

a guest
Oct 13th, 2019
3,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1.  
  2. - Paste made by zri
  3.  
  4. local localPlayer = game:GetService("Players").LocalPlayer
  5. local currentCamera = game:GetService("Workspace").CurrentCamera
  6. local mouse = localPlayer:GetMouse()
  7.  
  8. local function getClosestPlayerToCursor()
  9. local closestPlayer = nil
  10. local shortestDistance = math.huge
  11.  
  12. for i, v in pairs(game:GetService("Players"):GetPlayers()) do
  13. if v.Name ~= localPlayer.Name then
  14. if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") then
  15. local pos = currentCamera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  16. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  17.  
  18. if magnitude < shortestDistance then
  19. closestPlayer = v
  20. shortestDistance = magnitude
  21. end
  22. end
  23. end
  24. end
  25.  
  26. return closestPlayer or localPlayer
  27. end
  28.  
  29.  
  30. local mt = getrawmetatable(game)
  31. local oldNamecall = mt.__namecall
  32. if setreadonly then setreadonly(mt, false) else make_writeable(mt, true) end
  33. local namecallMethod = getnamecallmethod or get_namecall_method
  34. local newClose = newcclosure or function(f) return f end
  35.  
  36. mt.__namecall = newClose(function(...)
  37. local method = namecallMethod()
  38. local args = {...}
  39.  
  40. if tostring(method) == "FireServer" and tostring(args[1]) == "ThrowKnife" and getClosestPlayerToCursor() and getClosestPlayerToCursor().Character:FindFirstChild("HumanoidRootPart") then
  41. local humRootPart = getClosestPlayerToCursor().Character.HumanoidRootPart
  42. local pos = humRootPart.Position
  43. local vel = humRootPart.Velocity
  44. args[2] = pos + Vector3.new((vel.X >= 1 and 1) or (vel.X <= -1 and -1) or 0, (vel.Y >= 1 and 1) or (vel.Y <= -1 and -1) or 0, (vel.Z >= 1 and 1) or (vel.Z <= -1 and -1) or 0)
  45.  
  46. return oldNamecall(unpack(args))
  47. end
  48.  
  49. return oldNamecall(...)
  50. end)
  51.  
  52. if setreadonly then setreadonly(mt, true) else make_writeable(mt, false) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement