So, you just want to set the rotation
property of the weapon to the angle of your joystick? If so, something like this should work:
_process(delta):
$Weapon.rotation = joystick_vector.angle()
Obviously, you'll need to update the $Weapon
node reference and the name of the variable holding your joystick vector...