When you are asking an engine question you need to post the model number of the engine. Unfortunate that people start replacing parts with no idea what is actually wrong. IF this is by chance a V-Twin engine, the problem may be in the Kill Wire harness. Safety switches, seat switch, are possibilities.
Walt Conner