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

How do you detect if a part touched another part?

Hello I am trying to make a Touched event. I want a part to destroy itself when it touches another part? How do I do that and what do I do to destroy the part in the script?

1 answer

script.Parent.Touched:Connect(function(plays)
	if workspace:FindFirstChild("Terrain"):IsA("Terrain") then
		if plays ~= workspace.Terrain then
			script.Parent:Destroy()
		end
	else
		script.Parent:Destroy()
	end
end

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