Bought a zongshen storm.. Put a battery in and away I rode

After 3 days was riding and the bike shut off.. Started again then got it home.. Replaced the spark plug, coil and lead then it rode fine for a few more days then did it again.. Bike started again after a hour so o rode it home, waited a day to try it and it started first go

Anyone have a idea what is wrong