Advertisement
Upscalefanatic3

Item Factory Insta Kill

Oct 21st, 2021
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2.  
  3. local Connections = {}
  4.  
  5. local function MakeConnection(Mob)
  6. if not Connections[Mob] and Mob:FindFirstChildOfClass("Humanoid") then
  7. local z = game.Players:GetPlayers()
  8. for i,v in pairs(z) 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 Human = v:FindFirstChild("Humanoid")
  23. if Human then
  24. MakeConnection(v)
  25. end
  26. end
  27.  
  28. workspace.DescendantAdded:Connect(function(Child)
  29. local Human = Child:FindFirstChild("Humanoid") or Child:WaitForChild("Humanoid", 10)
  30. if Human then
  31. MakeConnection(Child)
  32. end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement