Custom Data Module [🔜]
FEATURE IS NOT CURRENTLY RELEASED
This feature is pending release and is not available in any public versions. Please check back soon, this feature will be in Version 7!
What is this feature?
Custom Data Module allows a developer to redirect player data to a Module Script rather then the normal Roblox DataStoresService. This is often used in high daily active players game's to manipulate the data saving process for features such as data loss prevention however can be used for other features dependent on what you script or the script you are using. Due to how advanced this is and failing to set up correctly can cause the system to break, I'd recommend following the tutorial below OR using the preset below which uses ProfileStore.
Settings Classes
DataModule
Folder
The folder to place the ModuleScript that will act as the DataStores. If non or more then 2 then defaults to DataStoresService.
GetDataFunction
String
The function string that the ModuleScript requires to get player data
GetDataVariables
String
The values and refrences that the Module Script get function requires.
SetDataFunction
String
The function string that the ModuleScript requires to set/update player data
SetDataVariables
String
The values and refrences that the Module Script set function requires.
StartupFunction
String
OPTIONAL -
StartupVariables
String
OPTIONAL -
How to set up
Firstly, place your module script that will act as the data store to the 'DataModule' folder. Ensure that it is a ModuleScript (purple script) to avoid errors
Next, Change GetDataFunction value to the string of the function used to retrieve the player data and do this for SetDataFunction.
Lastly, Check what veriables are required for the function and refer to the possible variables list below for help on refrencing. Make sure that there is a comma (, ) and space in between each to avoid errors.
Obtainable Variables
player
Instance
Returns the local player instance (may require .UserId to get the User ID)
Set, Get and Startup
playerstats
Table
Returns the raw table that is trying to be saved
Set
leaving
Bool
Returns true if the player is leaving the game and false if the player is resetting/dead
Set
backpackonly
Bool
Returns true if the game only want's the player backpack and false if it wants all player data
Get
DataStore
ModuleScript
Returns the Module Script being used for Custom Data Module. If non then returns DataStoreService
Set, Get and Startup
GetData
String
Returns the function string used to fire GetData
Set, Get and Startup
SetData
String
Returns the function string used to fire SetData
Set, Get and Startup
GetDefaultStats
Table
Returns the default values that a player first playing the game would recieve
Set, Get and Startup
Possible Errors
Error Information: Output Debugging enabled is not required to recieve any of these errors, when an error occours, the script will automatically switch back to Roblox DataStoresService to prevent further errors.
Only 1 instance can be in DataModule folder. Please ensure that there is only 1 ModuleScript in DataModule Folder
There is 2 or more instances/scripts in the DataModule folder
Only have 1 ModuleScript in DataModule folder
Module Script not found in DataModule folder
There is something in DataModule folder but it's not a ModuleScript
Replace what's in DataModule folder with a ModuleScript and ensure it does not return nil.
DataStore could not be set up correctly. Please follow the documentation or DevForums post for more infomation on how to fix.
The system experienced an error when requiring the module script.
Make sure the ModuleScript returns something except nil or you may be experiencing a Roblox related problem like an outage.
Last updated