So I created a part remover like this..
function removebricks() workspace.Part:Remove() end game.Workspace.PartDeleter.Touched:connect(removebricks)
and it works, but when I touch PartDeleter, it just removes any thing named part in the game. How would I make it so that if the part named PartDeleter was touched by a ton of parts, it would remove all of them?
--First thing's first: functions can have arguments. Think of --mathematical functions. function f(x) print(2 * x + 5) end f(1) f(2) f(3) --So, you call the function with an argument; an x-value in this case. --Strings can also be arguments. function echo(message) print(message) end echo("hey") echo("hi") echo("what's up") --Now, event listeners (functions you declare that you connect to --events) can also have arguments. If you visit this link:
--You see that it has the name of the event, Touched, and what it would --pass as an argument to it's connected function. Different events --pass different arguments. In particular, the Touched event passes the part that --touched as an argument to the connected function. Knowing that, let's make a function to --destroy whatever touches your part. function removebricks(PartThatTouched) --remove() is a deprecated function, meaning Roblox made a better version of it. Just use Destroy(). PartThatTouched:Destroy() end game.Workspace.PartDeleter.Touched:connect(removebricks)