Why does the oil pressure light flash?

Oil pump needs replaced,engine light comes on because of low oil preasure.I just changed mine out and it took care of the problem.