Help with welding an animated model to a moving model

There’s a ship I’m working in that needs an animated gate.
The problem is that if I add the qPerfectionweld script to the model, the animation won’t work.
I’ve tried to separate both models, but If I do so, the animated one won’t weld.

In summary, I’d like to weld moving parts (animated model) so they move along with the main model while working.