How can i secure the data save to avoid this case :

Hi , let’s say a player buy a devproducts in your game, then he leave the game some seconds after, unfortunatly the player removing data save is fail, so the player just loss robux and consider your game (and roblox per extension) to a scam. Is there a way to avoid this bad issue ? I’m using the normal datastore and i would like keep it (as i don’t really understand profileservice and it’s important for me to understand how the script work). Any help is appreciated, thank you

You can implement autosaving to prevent this issue.

1 Like

Yes, I’ve implemented an autosave. But let’s imagine that backups just bug out, there’s no way to make sure to replace the values, no matter if there’s an error or not. Or another solution?

In the process receipt function, try to do a save, if the save fails, return that it was not processed.

What do you mean , indicate to the player that the data failed ?

In the MarketplaceService.ProcessReceipt function, instead of returning PurchaseGranted, return NotProcessedYet

1 Like

Would this refund or not debit the player? Because I was assuming that the payment in robux is succesful, but that the backup after doesn’t work, thanks again for the help you’re giving me


Excerpt from the MarketplaceService documentation.

1 Like

Oh, so when the player returns on the game later (after failing the save), it will replay the purchase action until the function is valid?

No, it will just keep retrying to save your data over and over until it succeeds.

1 Like

I understand better, thank you for your help

Hold on, it might actually refund you if this part is hinting toward that.

1 Like

Either way, there is no way of guaranteeing success, but datastores failing that much is an indication of a problem with the Roblox API, not your game being a scam.

No, but with what you’ve shown me above, roblox has naturally put elements in place that we should use to avoid any problems

1 Like

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