Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats the appropriate time interval to auto-save?

Asked by 5 years ago
Edited 5 years ago

I was thinking about going about a while true do loop and autosaving

while wait(30) do
DataStore:SetAsync(plr.UserId,Val)

end

Some might say im overdoing it it but the max interval is 6 seconds really I could be saving 15 seconds

2 answers

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

It depends. You could have a game where the player's data changes frequently where you need to save the data often, but you could also have a game where the data doesnt change as much.

If the data failed to save when the player leaves and you had to rely on autosave, ask yourself: is the data that was saved two minutes ago alright? did the player lose a lot of data to the point where they'd be mad? if the answer is yes, then update more frequently. if not, you can get away with saving every 2-5 minutes.

If you save data too frequently, you might run into the issue of having too many requests to save data which causes your save requests to be added to a queue.

Ad
Log in to vote
0
Answered by 5 years ago

I recommend using looped ds: UpdateAsync () and ds: SetAsync () when the player leaves the room.

0
setasync() and updateasync()? royaltoe 5144 — 5y

Answer this question