Syrimzz

One Shot Any npc

Nov 26th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | Gaming | 0 0
  1. local Player = game.Players.LocalPlayer
  2.  
  3. local Connections = {}
  4.  
  5. local function MakeConnection(Mob)
  6. if not Connections[Mob] and Mob:FindFirstChildOfClass("Humanoid") then
  7. local tbl = game.Players:GetPlayers()
  8. for i,v in pairs(tbl) do
  9. if Mob == v.Character then
  10. return
  11. end
  12. end
  13. Connections[Mob] = Mob.Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
  14. for i = 1, 20 do
  15. Mob.Humanoid.Health = 0
  16. end
  17. end)
  18. end
  19. end
  20.  
  21. for i,v in pairs(workspace:GetDescendants()) do
  22. local Hum = v:FindFirstChild("Humanoid")
  23. if Hum then
  24. MakeConnection(v)
  25. end
  26. end
  27.  
  28. workspace.DescendantAdded:Connect(function(Child)
  29. local Hum = Child:FindFirstChild("Humanoid") or Child:WaitForChild("Humanoid", 10)
  30. if Hum then
  31. MakeConnection(Child)
  32. end
  33. end)
Add Comment
Please, Sign In to add comment