A bug was introduced recently in a place I’m working on that causes new player data to be corrupt and not save properly, but if you played before the update everything is fine – the issue is only present when you haven’t played before and your saved data is being created from the default inventory. Because I can’t set my inventory to nil, I have to test the game on an alternate account, which doesn’t have access to the developer console, and then I have to join that server on my main account on a different computer to view the server log. I could just change the datastore I’m using to SavedData2, SavedData3, etc, but what happens when I need to do that in a published game that has thousands of users with saved data? I can’t do that. This is extremely painful and it would be so much easier to debug if I could just set my own inventory to nil.
There is good reason to clear out datastore keys. We should be able to set their values to nil.
As a possible solution for now, you could set the data to false, so that when you have a check to see if a player’s data is nil, false will also return true
local Data = DataStore:GetAsync("Key")
if Data then -- will be false if Data = false or Data = 'nil
-- player has data
-- player does not have data, so write new data to it.
TBH, I wish we had a lot more functionality for the DataStores, such as the ability to write simple queries and stuff, such as you’d find in an ORM DB. Although perhaps that would introduce complexities that some people wouldn’t want to deal with.
Why would you link to such a cringe-y post of mine
I agree that we should have the ability to delete data. You can’t argue it could be used for more malicious activity as someone could just set all data keys to -21341234134 instead of deleting. And I don’t think Roblox is going to have a problem paying for less storage.
Having dealt with httpservice->database and its awesomeness, it’d be neat if we straight up had an actual database for each game. With my first lobby system in The Conquerors, I had to use a database because servers needed to be updated quickly for player joining/leaving/availability and having 5k players spread out in 1000 servers definitely made datastores impossible to use. It was great while it lasted(database shutdown from overuse), it’d be cool if I could’ve done it directly in roblox though