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

How do you make a brick for example destroy anything with the name "Part" once touched?

Asked by 10 years ago

I don't know if this is possible but its been in my mind for a while and it would be great if you could help me figure this out?

1 answer

Log in to vote
0
Answered by
jobro13 980 Moderation Voter
10 years ago

We want to destroy anything that touches a part with a given name.

local part = game.Workspace.Toucher
local name = "Part"
part.Touched:connect(partThatTouched)
if partThatTouched and partThatTouched.Name == name then
partThatTouched:Destroy()
end
end)
Ad

Answer this question