I need help with this model (Made with unions) and I need to script a motor6D for my monster.

I was using this script but it is not working so, can you help me finish my animation and eventually my game.