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

How do I make a block delete itself?

I would like to know if anyone has a script that makes a brick delete itself when it comes into contact with ANY another brick. It would be a great help, thanks ;)

1 answer

✓ Accepted answer

If you have the script inside the brick that deletes itself, in this case destroy then use the touched event.

This is if anything else touches it.

local part = script.Parent

part.Touched:connect(function(hit)
print(hit..' has touched this brick!')
part:Destroy()
end)

if you want per say a specific type of brick:

local part = script.Parent

part.Touched:connect(function(hit)
	if (hit.Name == "Lava") then
		part:Destroy()
	end
end)

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