So i’ve been trying to make a multi saving and loading data store. The leaderstats itself is working perfectly fine, same as the saving. But I am having issues of how I should tell the script what table to get and load from.
The loading part of the script:
local info = data:GetAsync("Data"..plr.UserId)
local s, e = pcall(function()
end)
if s then
Cash.Value = info.Money
Gems.Value = info.Diamonds
else
print("Couldn't load data.")
warn(e)
end
end)
info.Money is indexing nothing. I am guessing same goes with “Gems”.
The table found in SetAsync (saving) part of the script:
local tab = {Diamonds = plr.leaderstats.Diamonds.Value, Money = plr.leaderstats.Money.Value}
Your code is confusing, you have a pcall that is empty where the info line should be and give us more information on “Cash” and “Gems”, are they supposed to be info.Cash/Gems or not?
They are both intvalues being stored inside a folder named “leaderstats” and that is being stored inside the player. Sorry about that. Not sure, but I was attempting to get the values I told the table to get (local tab = {Diamonds = plr.leaderstats.Diamonds.Value, Money = plr.leaderstats.Money.Value} ) and put it into the intvalues I set up.