Updated and cleaned up files

This commit is contained in:
2023-11-15 19:08:13 +01:00
parent b897670c97
commit 325d310de5
8 changed files with 114 additions and 118 deletions

View File

@@ -0,0 +1,17 @@
function skywarsLevel(xp) {
var xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000];
let exactLevel = 0
if (xp >= 15000) {
exactLevel = (xp - 15000) / 10000 + 12;
return exactLevel;
} else {
for (i = 0; i < xps.length; i++) {
if (xp < xps[i]) {
exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1]);
return exactLevel;
}
}
}
}
module.exports = { skywarsLevel }