Suphi's DataStore Module

Issue is that I want it to act on player leave.

For example: if they leave while in-combat make them lose their saved inventory.

1 Like

can you not do it on the player removing event before you call the destroy function?

1 Like

Yes, but will destroy not prevent saving?
Or does that try to perform a last save automatically?

1 Like

destroy will automatically save one last time before closing

3 Likes

So I have a question regarding using Datastore:Open() and Datastore:Read(), which returns to things, a string and any.

First off, what are the possible things the string can be equal too? I know one of them is “Success”, but what else?

And then what exactly is the any?

Other than that I have no other questions, thanks!

1 Like

Success, Saved, Locked, State, Error


you can read about the any type here Type checking - Luau

image

the ? at the end of types indicates that it may also be nil

so
string? = string | nil
number? = number | nil
any? = any | nil

2 Likes

Quick question how do I clear a datastore with your module? Like remove its data

1 Like
dataStore.Value = nil

:muscle::watermelon::hammer::blush:

2 Likes

currently, I’m trying to migrate my project to use Rojo / Argon, in this migration I need to save project in .rbxl file everytime I change something in Roblox Studio.

The idea is I will need to run start build.rbxl from console. However, I get this error on SDM Plugin:

You must publish this place to the web to access DataStore. - Server - MainModule:98

Do you think that I need this support on Argon or SDM?

1 Like

you wont be able to use the datastore if you have not published not much you can do maybe comment out the parts that error of wrap them in pcall and ignore the errors when your not published

2 Likes

Question: Does this have a similar feature to ProfileService that allows “Mock” sessions to be created?

The usage I’m looking for: Saving data, but only for a single server for testing purposes.

EDIT: Nevermind. The “Disable Saving” section in “Suphi’s DataStore Module Extras - Roblox Scripting Tutorial” answers my question.

Your channel has helped me a ton during my journey. I plan to use this long term and heavily integrate it. Will the module continue to work fine as my game scales in systems?

I don’t see why it would stop working

1 Like

In case you doubt the reliability of this module, I wanted to share my personal experience with it.

Used it for my new game and everything is going great. MemoryStore usage is negligible (<2%), and no data loss at all. Main feature for me was the ease of use in programming it. Was able to develop all datasaving much faster compared to using ProfileService.

Overall a very robust system, thanks again.

3 Likes

Just wanted to chime in with a real-world example of this module being used by us in Zombie Zone, with 200+ CCU for the past month and no reports of any data issues. Amazing module and makes DataStores a breeze to work with. Thank you for this resource!

1 Like

Can anyone help me with this wrapper, Its not working and I’m not sure as to why

Hi,

I see that the SDM Module (downloaded using the toolbox) is a client script. So, is it no problem if I put this script under StarterPlayerScripts?

Thank You

its a modulescript and it only works on the server side

maybe you downloaded the wrong thing

Screenshot 2025-01-29 132845

ok, I think it’s client file as the color is similiar.

But how to make sure module script safe, are below suggestion correct?

A ModuleScript can work on both the server side and client side
but because Suphi’s DataStore Module only works on the server side
there is no point replicating it to the client (it would just waste network data for no reason)
so you will want to put the ModuleScript inside ServerScriptService or ServerStorage

I think this might be a good video for you to watch:

And maybe this one as well:

This should show you that replicating a ModuleScript to the client has zero effect for exploiters
exploiters are capable of injecting there own custom code/scripts any code found inside a ModuleScript is not required by the exploiter

1 Like