It keeps adding an extra } to the json file and wont add 1 to the level
I have tried to have it saving the original level value to a txt file then waiting a second then adding 1 to it.
if(xpout > 100) {
var lvupxp = xp.xp - 100
var expcontent = `{ "xp": ${lvupxp}, "level": ${xp.level++} }`
var exppath = `./Users/${message.author.username}/xp.json`;
fs.writeFile(exppath, expcontent, (err) => {
if (err) throw err;
})
}
{ "xp": 7, "level": 0 } }