Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I go about changing a value in a dictionary saved to a datastore?

As the title suggests, im confused on how to go about changing a value in a dictionary and im not sure if i can just do

data = store:GetAsync(plr.UserId)
data.Owner = "Bob"

or if i have to do some other complicated method.

1 answer

✓ Accepted answer

Your code is actually correct so far, although you aren't saving the datastore after changing the value. To save this value, we use the DataStore.SetAsync method. In your situation, it would be used like so...

local Data = store:GetAsync(plr.UserId)
Data.Owner = "Bob"
store:SetAsync(plr.UserId, Data)

Hope this helped! (please mark as answered if it did)

1 comment

0

this makes this so much easier thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.