You need to make sure that your distributor cap is dry and no water has come in contact inside of it. You can unscrew the cap and dry the inside with a cloth. Test drive it after that.
If your truck has a distributor I would imagine that water has contaminated the cap and rotor.
Spray WD40 under the cap and dry it with a rag.
Test drive.