Create a vector (or an entity, if you want) below the mouse, at the same height with player.z. Then, use vec_to_angle to rotate the player towards that vector / entity.