Datastore AutoSave Question

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

1 Like

what if the player got disconneccted becuz of internet if that happens the datastore doesnt save

1 Like

The player disconnecting should affect the client side though? So the server would think of it as a PlayingRemoving event

1 Like

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.

1 Like

You can use game:BindToClose(function() to loop through all players and save data if the server goes down.

1 Like

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.

idk if it’ll save or not but this is what the wiki says