Documentation | Source
Introduction
ProStore3 is a simple open source library used to easily manage and dynamically update a Roblox’s game database. It uses a session lock approach in which it stores and manipulates the users data from the moment they join the session to the moment that they leave.
This library allows you to add a database to your game in literal seconds! It has basically no learning curve and works out of the box!
I’ve been using this library for the past 10 months and decided to make a post about it now that I’m fully sure that it’s not only stable as it is scalable to larger projects.
In it currently being used by multiple games with hundreds of active players including Roblox Events.
Examples of a game using it:
Why would you use it?
- Saves a huge amount of time
- Very easy to edit/get data at run-time
- Data can be dynamically modified in the future meaning that adding a new value won’t overwrite any existing data
- Forces a schema similar to Mongoose or any SQL based database
- Helper events to easily update visual information in relation to user data
Tutorial
This tutorial will show you how to set up ProStore3 and its following advantages!
Installation
First you will need to download ProStore3 and drag it into your project. You can either download it from GitHub’s main branch and drag and drop into your Rojo project or download the free model.
I personally recommend keeping your copy somewhere around ServerScriptService
Setting up
There are 2 important files inside of ProStore3. These are the schema.lua and settings.lua. These 2 files will determine the data schema of your game and how should the database behave internally.
Information about the Settings: Settings | ProStore3 (prooheckcp.github.io)
Schema
In this file you should return an object that resembles how you want a players database to look like. The values you set will be used as default values. In the given example, as an example, the level will be locked into a number type and the player will start at level 1 when he first joins the game.
One of the greatest features about ProStore3 is that you can add more values into this schema at the future (or remove) and it won’t corrupt any already existing data.
return {
Level = 1,
Inventory = {},
Profile = {
SomeInt = 2,
Currency = 100,
NestedProfile = {
MoreNested = {
Another = {
value = 3
}
}
}
}
}
Using ProStore3
As soon as you require ProStore3 from any file in the game the library will start working and saving/loading players’ data! So no more setting up is required! But how exactly do we access/modify data from the player’s schema?
local ServerScriptService = game:GetService("ServerScriptService")
local ProStore3 = require(ServerScriptService.ProStore3)
ProStore3.PlayerJoined:Connect(function(player : Player)
local level : number = ProStore3.Get(player, "Level")
local currency : number = ProStore3.Get(player, "Profile.Currency")
print("Level: ", level, " Currency: ", currency) -- Level: 1, Currency: 100
ProStore3.Set(player, "Level", 3)
print(ProStore3.Get(player, "Level")) -- 3
end)
And that’s about it! You can start using the library as soon as u finish writing your schema as easy as that!
Events
ProStore3 also comes with a few events to help working.
PlayerJoined (I would highly recommend using this instead of Players.PlayerJoined event as it gets called after the players data finishes loading)
PlayerLeft
DataUpdated
Limitations
ProStore3 was designed to only work for players. You need a Player instance in order to get and or update data. It cannot be used for stuff like analytics and global data.
Fun Fact
This is the third time I write a fully managed DataStore library hence the name “ProStore3” instead of just “ProStore”.
Please leave your feedback down and or a⭐on the GitHub