oil pressure gauge works sometimes

Gauge regulator probably.

What car and what year?