Moreover on getting player leaderstats and storing them on a string on DataStore.
local DataStore = game:GetService("DataStoreService"):GetDataStore("UserStats")
game.Players.PlayerRemoving:connect(function(player)
local key = "user_" .. player.userId
DataStore:UpdateAsync(key, function(oldValue)
local statData = ""
for i, v in ipairs(player.leaderstats:GetChildren()) do
statData = (statData.." "..v.Name..": "..v.Value)
end
return statData
end)
end)
How can I return these values stored in 'UserStats' when a player joins? I was thinking of some string.sub and getting certain Ascii characters, but I'm not sure where to go on from there.

2 comments
:GetAsync(key) is what you want, not :UpdateAsync()
He is correct with it.