Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a part delete anything it touches even bricks?

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

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.

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.