![]() If this fails, retry the process for up to 3 tries (or whatever limit you specify). This might be a player leaving or an automated save process. Write to the data store when requested to do so.So, I think the best way to accomplish this would be to, for one, do what suggested with the Try package, and also to have a boolean variable (or use what I later suggested), which will determine if a data store request is being validated. However, the BindToClose function will do this. I’m assuming you’re confused as to why I said this, as Roblox does not shut down the server before the last player leaves. The BindToClose function takes care of this part by handling the request after the player leaves. Return success -Return true or false whether we successfully saved the players dataĮdit: Here is Roblox’s take on SetAsync() vs UpdateAsync() Data Stores | Roblox Creator Documentation Task.wait(attempts * 3) -First attempt won't wait, any subsequent attempts will wait 3 sec/attempt Return data -,, oldKeyInfo -You can uncomment the start of this to return a table of userIds associated with the data, and the oldKeyInfo (Which you can change) if you are using Roblox's MetaData for datastores Make any changes to data, or read oldData player.UserId, function(oldData, oldKeyInfo: DataStoreKeyInfo) local DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerData") You could use this package to Try() your save function and if it fails retry it after a set amount of time like the code does in the example. If it errors you can just call :Retry() on the Attempt and make it try it again. I have a package called “ Try” that let’s you try a function and then get the result, or catch the error. ![]() ![]() ProfileService is striving to be a DataStore solution that is the most accurate implementation of data storage following the development guidelines and practices provided in the official Roblox API. It’s completely stacked when it comes to protecting your game data from item duplication exploits. ProfileService protects your data only from the relevant Roblox server problems. ProfileService is an extension module which gives you powerful tools to manage profile session-locking, cross server gifting and profile data organizing. ![]() This includes session locking (locking data to one server so it can’t be accessed from another server to prevent item duplication and accidental data loss), and other features.Īs they state on the documentation for it:ĭataStore2 is mostly a Roblox DataStore wrapper module which automatically saves duplicates of your data. ProfileService is a single module script that implements many things that we should, but don’t, do when making our data loading and saving systems. While DataStore2 is good, there’s an even better source for data saving called ProfileService. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |