95 nissan V6. Need help

Need some advise. I have a 95 nissan pickup hardbody and speedometer goes in and out when it is out i just pound on dash and it will work. I took it apart and put white gauges on it and cleaned the connectors with electric spray. Put back together and it’s still doing the same thing. But now when I hit dash it dosent work. Check engine light does come on if it don’t work. But it did before till I pounded the dash then it went out. Ideas? Help? I suck at wiring

The vehicle speed sensor (VSS) or the wiring from the VSS may be bad. When the check engine light comes on, have the code read. If the code is P0500, that indicates bad VSS or wiring from VSS.