Ive been looking for a way to do this for a while. Cant find any pages or posts on it but this is the best I could come up with:
dx = mouse.x - Weapon.x
dy = mouse.y - Weapon.y
angle = atan(dy, dx)
if angle < 0 then angle = angle + pi*2
Weapon.rotation = angle
but it gets stuck within a small value.