Today, I was working on my datastore script, and then I forgot the autosave function, but then I realize what the point of autosaving player data when player data is saved when player leaves?
Lol
It honestly more or less depends on which scenario you’re really going for when saving Player Data, you could use a Autosave Interval, or save the data when the Player leaves the game
what if the player got disconneccted becuz of internet if that happens the datastore doesnt save
The player disconnecting should affect the client side though? So the server would think of it as a PlayingRemoving
event
If your server crashes, or there’s some data failure, a auto-save helps in that.
If you’re using ProfileService, auto saving is kind of essential anyway, and it fixes the issue which may come with auto saving throttling.
You can use game:BindToClose(function()
to loop through all players and save data if the server goes down.
I didn’t say goes down. I said CRASHES. BindToClose is for when a server shutdowns, either from request from the developer or the players left.
When a server crashes, bind to close won’t do anything, it won’t run. The server is truly crashed.