don't let it go under 0

merge-requests/4/head
loicbersier 5 years ago
parent ad707cf9d4
commit 7245991cd1

@ -87,13 +87,15 @@ class borgarCommand extends Command {
message.reply(`u won bro,,,, that's kinda epic if i do say so myself\n**you gained ${xp} xp. you now have ${totalXP} xp**`); message.reply(`u won bro,,,, that's kinda epic if i do say so myself\n**you gained ${xp} xp. you now have ${totalXP} xp**`);
} }
} else { } else {
let totalXP = curxp - xp; let totalXP;
body = {userID: message.author.id, level: level, xp: totalXP}; if (curxp <= 0) {
if (curxp == 0) {
message.reply(`you failed noob... you were supposed to make **${hamIngredient}**`); message.reply(`you failed noob... you were supposed to make **${hamIngredient}**`);
totalXP = 0;
} else { } else {
message.reply(`you failed noob... you were supposed to make **${hamIngredient}**\n**you lost ${xp} xp. you now have ${totalXP} xp**`); message.reply(`you failed noob... you were supposed to make **${hamIngredient}**\n**you lost ${xp} xp. you now have ${totalXP} xp**`);
totalXP = curxp - xp;
} }
body = {userID: message.author.id, level: level, xp: totalXP};
} }
if (curxp == 0) { if (curxp == 0) {

Loading…
Cancel
Save