I've recently stumbled across DataStore2, and I was wondering how I could save the value inside a table? I've managed to change it - but it won't save
The table looks somewhat like this, stored inside a modulescript
local table = {
["Fire"] = {
Owned = false,
Mastery = 0,
MasteryExp = 0
}
}
Now, in a serverscript, I save this table to a player the first time they join, as so
local DataStore2 = require(datastore2assetid)
DataStore2.Combine("Key", "Table")
local table = require(module)
local PlayerData = DataStore2("Table", Player)
PlayerData:Set(table)
I can change the Owned value of fire to true by doing this, but it doesn't save - how do i get this to save?
local pData = PlayerData:Get(Player)
pData["Fire"].Owned = true
-- Using pData:Save() returns an error?
Thanks in advance for any help!
Edit: Would serialization work for this type of inventory?
