What happens if I have a save script in my game that loops through and saves values, but the player’s device dies due to zero battery? Will it save everything until the process is complete and then shut down, or what?
Should i consider using game:bindToClose() or soemthing because saving all the things might take maximum 10 seconds and i want to make sure everything is saved and no data losses happens
so i should consider using bindtoclose() instead of player.removing? like the values are stored in the player so if it leaves then there will be dataloss right? because the values arent avaible anymore cuz i need the players id and stuff like that?
player.removing will work if the player leaves, crashes, their device dies, etc. BindToClose() is used for when the server is shutdown by roblox (or the dev). ideally you want to have both and make BindToClose() loop trough all players on its event