Advertisement
Xnaate

Zombie Uprising Silent Aim Script!

May 12th, 2023
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | Gaming | 0 0
  1.  
  2. local uis = game:GetService("UserInputService")
  3. local cam = game:GetService("Workspace").CurrentCamera
  4. local ts = game:GetService("TweenService")
  5. local plr = game:GetService("Players").LocalPlayer
  6. local zombies = game:GetService("Workspace").Zombies
  7.  
  8. local function getClosestSilent()
  9. local closestDist = math.huge
  10. local closestPlr = nil
  11. for _, v in next, zombies.GetChildren(zombies) do
  12. if game.FindFirstChild(v, "Humanoid") and v.Humanoid.Health > 0 then
  13. local vector, onScreen = cam.worldToScreenPoint(cam, game.WaitForChild(v, "Head", math.huge).Position)
  14. local dist = (Vector2.new(uis.GetMouseLocation(uis).X, uis.GetMouseLocation(uis).Y) - Vector2.new(vector.X, vector.Y)).Magnitude
  15. if dist < closestDist and onScreen then
  16. closestDist = dist
  17. closestPlr = v
  18. end
  19. end
  20. end
  21. return closestPlr
  22. end
  23.  
  24. local namecall;
  25. namecall = hookmetamethod(game, "__namecall", function(Self, ...)
  26. if not checkcaller() and tostring(getcallingscript()) == "Framework" and string.lower(getnamecallmethod()) == "findpartonraywithignorelist" then
  27. local args = {...}
  28. local closest = getClosestSilent()
  29. if closest then
  30. local origin = args[1].Origin
  31. args[1] = Ray.new(origin, closest.Head.Position - origin)
  32. end
  33. return namecall(Self, unpack(args))
  34. end
  35. return namecall(Self, ...)
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement