Issues in model with animation and script

So i made a script to open the gate, but seems it not working with the animation model, only if i remove the motor 6d and replace part orders.
How i make a model to work with both ( animation + script)
TqPmkF0fA9

Rbxl:
Gate.rbxl (151.6 KB)