Hello. I want to make that a Block with the name "Part1" detect if a Block with the name "Part2" touch the Block(with the name "Part1"). How it works?
Touched allows you to fire a function when one part touches another.
Check if the Part it touched is called Part2
local Part1 = workspace.Part1; Part1.Touched:connect(function(hit) if hit.Name == "Part2" then -- Touched! print("Touched") end end)
This checks if a Part in Workspace touched a Part called Part2 and prints Touched if it did