Pinning the weapon is one way to do this.
But probably a better solution would be to define an image point on the tip of the weapon (say, sword) and check if this point is overlapping an enemy:
System-> Pick Enemy overlapping point (character.imagePointX("weapon"), character.imagePointY("weapon"))