I want it so when you touch a part it kills you, and I can't seem to find my mistake:
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild(Humanoid) then
hit.Parent.Humanoid.Health = 0
end
end)
I want it so when you touch a part it kills you, and I can't seem to find my mistake:
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild(Humanoid) then
hit.Parent.Humanoid.Health = 0
end
end)
The findFirstChild function requires a string, as it finds by an instance's name.
It should be:
if hit.Parent:findFirstChild("Humanoid") then
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks.