Why would a 2000 Windstar make tapping sounds when the car is in drive or reverse you don't hear them when it idles and the oil is not low?

ours was making a teerrible knocking noise like it was low on oil. also the check engine light was stuck on. had a shop replace some gaskets (upper manifold maybe?) and noise is gone.