How do you make a part have the ability to delete a part it touches. I'm thinking of making a game where structures break and when they fall in the pit, there's a part in the pit where it destroys anything it touches
✓ ANSWER ACCEPTED
How do you make a part delete anything it touches even bricks?
1 answer
✓ Accepted answer
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Humanoid then
hit.Parent.Humanoid.Health.Value = 0
else
hit:Destroy()
end
end)
This script should destroy anything that touches it. If it is a player it will kill the player. For this to work properly do the following:
Select Players in the Explorer window.
In the Properties window set RespawnTime to 0.01.
If this helped please accept this answer.
All the best,
PrismaticFruits.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks, the "else" part of your code was my problem