Data Persistence - Simple DataStore wrapper!

The newest version from 2025-06-25 is available here:
DataPersistence.rbxmx (6.5 KB) or here
i made this module so I could easily swap out legacy DataPersistence calls that no longer function then i realized this module would probably be a good standalone datastore module

it features basic error checking, autosaving, and automatically loads player data into the cache without needing you to write boilerplate code! all you need to do is require the module, get the player functions, and start saving data!

API docs

dat:IsReady(p : Player) - Returns whether a player’s data is loaded and can be saved

dat:RegisterJoinFunction(name,func) - Registers a function that runs after a player’s data has been loaded
Depending on the situation you should either use this or wait for dat:IsLoaded() to return true
functions should be structured like so:

dat:RegisterJoinFunction("test",function(p: Player, plrdat) --info about plrdat is below
   print(plrdat:LoadValue("super secret string"))
end)

dat:RemoveJoinFunction(name) - Removes a join function

dat:GetFunctions(p : Player) - Returns the player interface
the player interface has all of the old data persistence functions (excluding LoadInstance and SaveInstance) along with LoadValue and SaveValue
LoadValue and SaveValue are recommended but all of them function identically and don’t even have type checking

The interface has the following functions
plrdat:SaveNumber(key,value)
plrdat:LoadNumber(key)
plrdat:SaveString(key,value)
plrdat:LoadString(key)
plrdat:SaveBoolean(key,value)
plrdat:LoadBoolean(key)
plrdat:SaveValue(key,value)
plrdat:LoadValue(key)

The following functions are used in DataPersistenceLoader
dat:LoadPlayer(p : Player)
dat:RemovePlayer(p : Player)

it is recommended you just use the bundled script as it handles joining, leaving, and the server shutting down for you

To install

Insert the model, remove the scripts from the folder, and place them both in ServerScriptService
Make sure to enabled studio access to API services!

Note: i can’t get data to save in studio, only load which I am pretty sure is a roblox bug
both data saving and loading works ingame!
the bug resolved itself sometime in July of 2024, saving works in studio now

leave any feedback in the comments!

2 Likes

Added retries and a mechanism that stops data from being saved when an attempt to save it is already in progress

1 Like

why would I use this when there is already great alternatives that are trusted such as

  • ProfileService
  • Easy Datastore
  • Datastore2

Also it looks like you are going to other posts to try to market your plugin on them as @KrimsonWoIf pointed out

Considering it only took you 20 minutes also is yikes.

1 Like

i made this for a game to replace data persistence calls
i didnt “market” it on KrimsonWolf’s page
i acknowledge this is a horrible module and there are alternatives that are actually good (ProfileService, Datastore2)
KrimsonWolf’s module, EasyDatastore, manages to be worse than this though

I linked this on his page because this has the same feature level of his but was made in 10 minutes

1 Like

why even post it as a resource if you believe this module is horrible then? Was the whole point of creating this just so you could troll easy datastore (which is not that bad from what I’ve seen)

this post is 2 months old

so if anybody else needs a quick and sloppy replacement for DataPersistence calls they can use this one? its “horrible” if you expect a datastore module that functions like datastore, not if you just swap out calls in a 10 year old game like i made this to do

1 Like

DataPersistence.rbxm (3.2 KB) (OLD VERSION, USE THE NEW ONE!)

I updated it so it conforms to --!strict but roblox deleted it for "misusing roblox systems`
download it here until i spam reports enough to get it back online

1 Like

I love this module. Makes everything so much more simpler and streamlined for my game. I will be working on a complex fighting game and I will see to it that this module will be utilized for everything data-related.

My updated version from around ~1 year ago still works well for me to this day! I think its stood up well enough to this point that I actually recommend people use it!

This current Roblox “outage” thats been going on for a few weeks helped me find an edge case where if your data takes too long to load it can crash scripts

working on a fix right now

EDIT: Fixed!
DataPersistence.rbxmx (6.4 KB) (OLD VERSION)

I just learned that DataStores have a new parameter for UserIDs to automate GDPR requests

New version that adds the player as metadata for all players who join after the update:
DataPersistence.rbxmx (6.5 KB)

I was able to successfully reupload the model to the toolbox without it getting moderated!
I will still post RBXM files for new updates but it can also now be downloaded here:

2 Likes