Exercise 8.1 – Building and testing data stores
We will create a DataManager
module from scratch by following a few steps in this exercise. You can use the example DataManager
that we made earlier in the chapter to help you. However, it is highly recommended that you try to mix whatever you have learned from the individual sections.
Once we have created our DataManager
, we will create a server script that handles incoming requests to purchase tools. This way, we learn how to verify incoming requests from a client that is directly involved with the data stores.
Exercise
We will start by making our DataManager module. Follow these steps:
- Create a new ModuleScript inside of the ServerScriptService service and name it
DataManager
. - Inside
DataManager
, create a table namedDataManager
at the top of the script and return this table at the bottom of the script. - Declare a new variable named
DataStore
with the namePlayerData
using the:GetDataStore()
function...