You can connect the same function to both events if that’s what you’re trying to do like so:
local function onTouched(part)
end
part1.Touched:Connect(onTouched)
part2.Touched:Connect(onTouched)
If you’re trying to connect a lot more than 2 events, you can create a table, iterate through it, and in each iteraction, connect the part’s event to the predefined function:
local Parts = workspace:GetChildren()
local function onTouched(part)
end
for i,v in pairs(Parts) do
if v:IsA("BasePart") then
v.Touched:Connect(onTouched)
end
end