Hi, So I'm currently a bit confused with DataStores, and I'm trying to specifically get them to save a string variable (called 'Value') that is located in game.Workspace. I have so far created a script that should save the player's data on exit (which I will share below) however, after looking through the ROBLOX Wikia and many other places I haven't found anything that will load data.
Here is the code I created to save player data
local DataStore = game:GetService("DataStoreService"):GetDataStore("Cash")
game.Players.PlayerRemoving:connect(function(player)
local key = "user_" .. player.userId
DataStore:UpdateAsync(key, function(oldValue)
local newValue = oldValue or 0
newValue = newValue + game.Workspace.Value.Value
return newValue
end)
end)
Thanks for any help you can give me.

4 comments
:GetAsync()
How would I use it though?
Would I do something like DataStore:GetAsync() local key "user_" .. player.userId??
It somehow looks like youre saving number values. If you want them to save a specific string just set oldValue to the strings value.