Need help rewriting / fixing datastore script

In my experience, datastores don’t work very well in studio.

From what I know it’s something to do with PlayerAdded and PlayerRemoving.

I have found that they work better in non team create places though. If anyone has a detailed reason why they don’t work let me know.

1 Like

Alright, thanks for letting me know! :slight_smile:

Also, is it a bad idea to migrate everything like settings & the system datastore to the new system, but keep things like Credits on the old system?

Credits is only 1 key, but I suppose it’s a bit inefficient. Not really sure though tbh.

You’d need to look at how many players there are in your game, and probably toning down the autosave time to at least 120 seconds. But I don’t know why you would transfer everything except for credits.

The only reason i can see you doing this is for a ordered data store…?

I just don’t want to accidentally wipe someone’s credit data.

Settings & System are pretty easy to reset - all you’re losing is your field of view settings, or a value determining if you’re banned or not, and your previous data, which I was planning on resetting anyways.

Also, @Nightrains

The table conversion is returning Bools as Object values - what’s causing that?

When you save the data, do you convert the folder into a table with the module?, if the data folder has a BoolValue, when you convert the folder into a table and then this table convert it to a new folder it should give you BoolValue.

1 Like

Hmm… I just directly save it with

	SystemDataStore:SetAsync("Settings"..player.UserId, currencyTypes)

CurrencyTypes being a table that contains all of the objects within the Settings folder.

They’re bools in the DataStore by the way (double checked in the DataStore editor.)

Try using this module I made instead: TableConvertion.rbxm (1.0 KB)

1 Like

Thanks!

When I opened that up, I noticed that Boolean was missing in the previous module - all I had to do was add “isA(Boolean)” and it loads in booleans now. :clap:

2 Likes