If you don't know what I mean by this, it's kinda like a tower defense game were the tower rotates to face the enemy and shoot it. I want a small explanation on how it works also so I can learn from it.
I haven't tested anything only because I don't even know where to start.
Ok, this does not have to include scripting, but it can. You can insert an AlignOrientation and two attachments. Put the AlignOrientation and 1 attachment into the 1st part and the 2nd attachment into the second part. Also insert this piece of code:
workspace.Part1.AlignOrientation.Attachment0 = workspace.Part1.Attachment workspace.Part1.AlignOrientation.Attachment1 = workspace.Part2.Attachment