I tried googling this but all that came up was if the player touched the part. Can somebody show how to do this?
local part = script.Parent part.Touched:connect(function() local touching = part:GetTouchingParts() for parts,touchingpart in pairs (touching) do print(touchingpart.Name) end end)
This script prints the names of all parts that touch the part
local part = script.Parent part.Touched:connect(function() local touching = part:GetTouchingParts() if #touching == 2 then --script here end end)
this script executes your code when 2 parts touch the part
this sometimes bugs so i would prefer to use this:
local part = script.Parent wait () while true do wait () local touching = part:GetTouchingParts() if #touching == 2 then --script here end end)