I'm trying to save some values to a datastore, however you can't save dictionaries. I have one below as an example:
{ ["Money"] = 0, ["Cars"] = "One, two, three", ["DistanceWalked"] = 16 }
EDIT: This is the code I'm using - The SaveOther folder contains about 6 values, the name of all of them are strings, but the values themselves are integers AND strings.
local datastore = game:GetService("DataStoreService")
while true do
wait (30)
print ("lets go")
local players = game.Players:GetChildren()
for i=1, #players do
local player = players[i]
local cardata = player.PlayerData
local playerstats = datastore:GetDataStore("TempStats")
--cardata = playerstats:SetAsync(player.UserId.."_Stats",cardata)
local values = cardata.SaveOther:GetChildren()
local mytable = {}
for a=1, #values do
mytable[values[a]] = values[a].Value
print (mytable[values[a]])
end
print(mytable)
local testtable = {}
testtable[1] = mytable
print(tostring(player.UserId.."_Stats2"))
local key = tostring(player.UserId.."_Stats2")
playerstats:SetAsync(key, testtable)
end
end
I get the "09:50:24.466 - keys must be strings" error, although I can't understand why they're not strings.

3 comments
Who says you can't save dictionaries into a datastore? As long as EITHER all the keys are strings OR all the keys are sequential ints from 1 to x, you should be able to save it into a datastore. http://wiki.roblox.com/index.php?title=Data_store#Tables_with_mixed_list_.2F_record_style_will_be_cut_off
I'll update teh question with my code and the error I get, someone had said on a forum post that the values have to be arrays instead of dictionaries.
Unrelated, but do :GetPlayers() instead of :GetChildren() for line 5.