Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I pick out 2 blocks that are touched?

Asked by 10 years ago

Im a little confused on how you pick out 2 blocks that may have been touched. So as if, one block was touched, that counts. If the other block it touched, it counts too. Please help

0
thanks for the help KennySfromTitan 106 — 10y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

If what you're trying to ask is how to have two parts' Touched events connected to the same function, all you have to do is declare the function as a variable.

function touched(hit)
    print("one of the two parts was touched by "..hit.Name)
end

part1.Touched:connect(touched)
part2.Touched:connect(touched)
Ad

Answer this question