function kill(victim)
victim.Parent.Humanoid.Health=0
end
script.Parent.Touched:connect(kill)
My question is why it kills only one time then says "Disconnected event because of exception." Is it because there's not an if-then statement in there?

3 comments
Thanks. I am still confused why mine didn't work. Can you explain?
The script probably broke when a part that didn't have a Humanoid touched it. This script first checks if the part's parent has a humanoid before trying to change it so that if it encounters a part without a humanoid, it will not break
WHY IS JAV SO GOOD? IS HE THE SAVIOUR THAT HAS COME TO HELP US?!