06:00 PM 01/06/2022
const savingInterval = 30000 // Time in MS
const dataSaver = getModule("dataSaver")
Game.on("initialSpawn", (player) => {
let data = dataSaver.read(player.userId, false) //tries to read the file where the score is saved
if (data == undefined) { //if there is no file it will return undefined
dataSaver.write("0", player.userId)//creates a new file with the id of the player and the value of 0
} else {
player.setScore(parseInt(data))
player.lastSavedScore = data
}
player.setInterval(() => {
if (player.lastSavedScore === player.score) return
player.lastSavedScore = player.score
dataSaver.write(player.score.toString(), player.userId)
}, savingInterval)
})
Game.on("playerLeave", (player) => {
dataSaver.write(player.score.toString(), player.userId)
})
const dataSaver = getModule("dataSaver")
Game.on("initialSpawn", (player) => {
let data = dataSaver.read(player.userId, false) //tries to read the file where the score is saved
if (data == undefined) { //if there is no file it will return undefined
dataSaver.write("0", player.userId)//creates a new file with the id of the player and the value of 0
} else {
player.setScore(parseInt(data))
player.lastSavedScore = data
}
player.setInterval(() => {
if (player.lastSavedScore === player.score) return
player.lastSavedScore = player.score
dataSaver.write(player.score.toString(), player.userId)
}, savingInterval)
})
Game.on("playerLeave", (player) => {
dataSaver.write(player.score.toString(), player.userId)
})
10:40 PM 03/06/2022
What does it do?
01:23 AM 04/06/2022
Quote from XxEmeraldxX , 10:40 PM 03/06/2022I’m assuming it saves points
What does it do?
02:41 AM 12/06/2022
Thing is, it's not getModule(dataSaver), it's supposed to be fs.
Also, this script is outdated and a newer version is a lot better than this one.
Also, this script is outdated and a newer version is a lot better than this one.
07:03 PM 19/06/2022
[ Content Removed ]