So I am currently making a ROBLOX obby and I want to insert a Kill Part, that kills you on touch.
script.Parent.Touched:Connect(function(hit)
if hit and hit.parent and hit.parent:FindFirstChild("humanoid")then
hit.parent.humanoid.health = 0
end
end)
This is the script I have come up with, with the help of a tutorial. I have tested my game and it isn’t working when I touch the part. Any assistance would be greatly helpful.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:BreakJoints()
end
end)