what will cause an eratic idle and throw a light on 1993 Chevrolet S10

have replaced the cap rotor plugs wires and egr

Asked by for the 1993 Chevrolet S10
Would help if you supplied the code attached to the light. Have a parts store attach scanner and hit us back with code.
1 more answer
More than likly you have a vacuum leak. The way to locate where would be to get a can of carbuerator cleaner and with the engine running spray around the throttle body and vacuum line and listen for a change in idle.