Okay, I understand your question now. I have built a 3D LiDAR scanning system the same as you describe here.
To get the 3D LiDAR data it's not ideal to manually add z values to the point cloud, the way to do this is to use the TF system. You need to generate a Transform that describes the location and orientation of your LiDAR sensor in a suitable parent frame (body_frame for a rover or world for a fixed sensor). When your servo moves, this Transform needs to update to reflect the changing position of the LiDAR sensor.
The frame_id of the 2D laser scan messages needs to be set to the new sensor frame you've created, so that when the servo moves the points will be shown in the correct place in RVIZ. This is the correct way of handling moving sensors in ROS.
If you want to assemble these scans into a single point cloud, convert each laser scan message to a point cloud then transform it into the parent frame. Adding these transformed 2D point clouds into a single point cloud will create a single 3D point cloud.
Hope this helps.
You already do. The Z value of all points from a 2D laser scan will be zero. Where are you expecting to get the z information from?
i intentionally wants to provide various z values to my point cloud , so that each time my laser, which is mounted on a servo motor tilts by an angle, the same can be reflected in the plot in rviz