Ad
Log in to vote
1

A script that destroys a part on touch with a different part

Asked by
Exsius 162
7 years ago

Im trying to make it so that when part1 touches part2, part2 disappears any help?

Thanks,

Exsius

1 answer

Log in to vote
1
Answered by 7 years ago
function onTouched(hit)
    if hit.Name == "part1" then
        script.Parent:Destroy()
    end
end

script.Parent.Touched:connect(onTouched)

This script goes inside part2.

0
Ok thanks! Exsius 162 — 7y
Ad

Answer this question