Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Exsius 162
10 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 10 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 — 10y
Ad

Answer this question