Advertisement
iExotixPloitz

Aimbot and ESP Hack script for KAT 2021

Jan 3rd, 2021
20,554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. --Subscribe to IExotixPloitz
  2.  
  3. function nearestPlayerToRay()
  4. local dist = math.huge
  5. local ray
  6.  
  7. for i,v in pairs(game.Players:GetChildren()) do
  8. if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character:FindFirstChild("Head") and not v.Character:FindFirstChild("ForceField") then
  9. if v.Character.Humanoid.Health > 0 and v.Character:FindFirstChild("Head") then -- needed..
  10. local newVec = (v.Character.Head.Position - game.Players.LocalPlayer.Character.Head.Position)
  11. if newVec.magnitude < dist then
  12. local toRay = Ray.new(game.Players.LocalPlayer.Character.Head.Position, newVec)
  13. if not workspace:FindPartOnRayWithIgnoreList(toRay, {game.Players.LocalPlayer.Character, v.Character, workspace.WorldIgnore, workspace.CurrentCamera}) then
  14. dist = newVec.magnitude
  15. ray = toRay
  16. end
  17. end
  18. end
  19. end
  20. end
  21. return ray
  22. end
  23.  
  24. local ray
  25.  
  26. function init()
  27. local knife = game.Players.LocalPlayer.Character:WaitForChild("Knife")
  28. local scr = getsenv(knife.KnifeServer.KnifeClient)
  29. if scr then
  30. local ir = scr.inputReleased
  31. local u7 = debug.getupvalue(ir, 2)
  32. local cam = debug.getupvalue(ir, 5)
  33. debug.setupvalue(ir, 5, setmetatable({}, {
  34. __index = function(t,k)
  35. if k == "ScreenPointToRay" then
  36. if ray ~= nil then
  37. return function() return ray end
  38. end
  39. end
  40. return cam[k]
  41. end
  42. }))
  43.  
  44.  
  45. while wait(.1) do
  46. if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
  47. break
  48. end
  49. ray = nearestPlayerToRay()
  50. if ray then
  51. scr.inputDown()
  52. u7.ChargeStart = -math.huge
  53. ir()
  54. end
  55. end
  56. end
  57. end
  58.  
  59. init()
  60. game.Players.LocalPlayer.CharacterAdded:connect(function()
  61. print("hi")
  62. wait()
  63. init()
  64. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement