i want the height map from the textures but I also want the heightmap from the high poly mesh so I can apply it to a low poly mesh. I want both in one heightmap but I don't know how to. please help
And also, to add to all of that.
(i) You can use the technique above to bake a height map as well.
(ii) You can also heavily subdivide a mesh using the multires modifier and then apply the texture to a displace modifier. This will help for baking height maps as well as normal maps.
You will have to twiddle those bias and distance settings for baking selected to active. They are very difficult to configure on curved surfaces.
EDIT: I almost forgot about the following setup. It's for baking a height map using Cycles. It was posted on BlenderArtists.org a while back. Currently it only works for planer projection, not curved meshes, but when the situation is appropriate, it generates flawless height maps.