How to move a part to another part's surface?

Hey guys, I can’t help but get confused about how to do this specific thing:
I have 3 parts, and I want each one of them to connect:
https://gyazo.com/7a9f78a7eba09a42e9003346eb5eff3b.png

https://gyazo.com/66c3171cbee298e13c082151cb554e68.png
^ like this, but using code.
Can anyone explain any trick or method to do this?

This topic was automatically closed after 1 minute. New replies are no longer allowed.