How do you lock an object to another vector? Building tool wrench mechanic

That did it, but now I’m approaching the issue where the rotation isn’t in it’s correct position. I need to lock its Z and Y axis but I am unsure how to visually script that.