Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I go about adding a new Index into a datastore?

Asked by 3 years ago

So lets say I have a table of stats

Tbl = {
    ['Gold'] = 0,
    ['Cash'] = 0,
    ['A New Index to be added'] = 0



}

So lets say I have ['A New Index to be added'] and I want to add it to the datastore

how would I add it

I was thinking of

doing

S,E = pcall(function()
    return MyDataStore:GetAsync(Player.UserId)

end)

if S then
    --Put the new value and call  :UpdateAsync to save it.


end


But I was thinking if this was wrong

What is a better way to put new values into your datastore table

Answer this question