How was this animation made? I mean, how this weapon was attached?

Yeah, looking at the video, I also think the weapon is part of the skeleton.