Loading/Saving from Roblox Studio
Loading the Module
First, load the module in your script by requiring the module, like this:
local returnedDB = require(game.ServerStorage:WaitForChild("returnedDB_Module")Now, create a new instance with your token by doing:
local DB = returnedDB.create("YOUR TOKEN GOES HERE")Now, to read a value, simply do:
local example = DB:Read("KEY NAME") -- This will return it's value or nil if it doesnt exist
print(example)And to write a value, do:
DB:Write("KEY NAME", "VALUE EXAMPLE")Do not set value to an instance or a lua table, instances cannot be stored and tables must be turned into JSON before storing it
A full example would be:
local returnedDB = require(game.ServerStorage:WaitForChild("returnedDB_Module")
local DB = returnedDB.create("XGUFYGSUDYFGAWYEGIAYUGROE")
DB:Write("pro user", "returnedmath") -- store the value
local pro user = DB:Read("pro user") -- This will return it's value or nil if it doesnt exist
print(example) -- prints "returnedmath"Last updated