Hello, so I’m basically trying to store a table with datastore but I’m getting a Argument 2 missing or nil error.
Table:
local number = {
num1= {"1","2","3"},
num2= {"4","5","6"}
}
How should I go along saving and loading this data? Any suggestions will be appreciated.
1 Like
Forummer
(Forummer)
#2
What does the SetAsync()/UpdateAsync() call look like?
local saveValue = number.num1 --variable to save
data = ds:GetAsync(player.UserId) --getting data
ds:SetAsync(player.UserId, saveValue) --setting data
My datastore script works fine, but it wont work with the table.
Forummer
(Forummer)
#4
Are num1 and num2 declared variables? If not the table you’re trying to save should look like this instead.
local number = {
["num1"] = {"1","2","3"},
["num2"] = {"4","5","6"}
}
ds:SetAsync(player.UserId, number)
That’s a fair point however, I’m still getting a Argument 2 missing or nil error.
Forummer
(Forummer)
#6
Can I see the larger script for more context?