Doesnt work... ._.
script.Parent.Touched:connect(function(hit)
print(hit)
hit.Parent.Humanoid.Health = 0
end)
Doesnt work... ._.
script.Parent.Touched:connect(function(hit)
print(hit)
hit.Parent.Humanoid.Health = 0
end)
This will work, but only as long as the touched never errors.
A lot of contacts, though, would cause this to error.
Always include robust error checking in your code.
script.Parent.Touched:connect(function(hit)
print(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks