What are some good times to do a datasave on a obby

Hello, I am making a obby and I was wondering how often I should do a data save. Im wondering this because I heard roblox has a data save limit. Do you think a data save after every stage is too much?

Try saving the data every time a player leaves, if you want to save it after every stage i’d reccommend using ProfileService, and if that article is too hard here’s the easy tutorial on it

will that work if they disconnect though?

Yes. Profileservice will automatically handle data like that and if there are roblox api errors, or the player is found in another server, or something like that it will kick the player so they don’t lose data or anything.

PlayerLeaving fires whenever the player is removed from the server. This includes disconnects. Here are the times that I would save:

  • Every X minutes.
  • After completing X stages.
  • After a purchase has been made.
  • Whenever the player leaves.
  • When the Server closes (see BindToClose)

I wouldn’t use all of them as that could reach the rate limit quickly, but the last 2 or 3 are absolutely necessary.

1 Like

Using profileservice can also prevent mass rate limits and allow you to save more data, just putting that out there!

2 Likes

I already coded a datastore, is it worth to switch to profile service?

I wouldn’t worry about it for an obby game. ProfileService is useful for games which store a lot of data and rely heavily on that data. In the case of an obby game, you’re really only saving 1 value, which is the current stage (unless you have extra data, of course)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.