Part = script.Parent
Part.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then humanoid.Health = 0 end end)
It worked normal for me. Perhaps its that its parented to something that isnt a part? anyways,
Part = script.Parent Part.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid") if humanoid then humanoid.Health = 0 end end)
Try this. About your script, it likely wont work because of some scripts that come in free models that change the humanoid's name, and those stuff. Try not using free models. i guess
Not sure if this could cause it for setting health to 0 not registering or something, however you could try this.
Part = script.Parent Part.Touched:Connect(function(hit) local char = hit.Parent char:BreakJoints() end)
Closed as Non-Descriptive by hiimgoodpack and BlackOrange3343
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?