What you describe is perfectly achievable by inverse kinematics, which you name-drop in your post. Have you tried using it at all yet? If not, take a look:
This is an example from one of my projects, using this resource as a starting point, which you may have seen, but you can find a plethora of posts within the forums using the exact same method described there for both arms and legs.
Edit: Regarding your code itself, if you strictly want the arm to point toward a target, then you should take a look at CFrame.lookAt. You’ll need both a position from your Motor6D (i.e. a stored C0
CFrame position) and a position from your target, ideally translated into your Motor6D’s Part0
object space. From there, you’ll have to play around with angles and offsets.