I have a table in a data store which has a table inside of it. When I tried accessing that table or printing it, it just gave a hexadecimal output. Looping through the table did not work for me either. So after some research and questioning I implemented these two functions to get the data:
local function dumpTable(tableToDump)
local tbl = {}
if type(tableToDump) == "table" then
for i,v in pairs(tableToDump) do
wait()
table.insert(tbl, tostring(v))
end
return "{" .. table.concat(tbl, ", ") .. "}"
else
return nil
end
end
local function changeStringToTable(tbl)
local finishedTable = {}
for int in string.gmatch(tbl, "%d+") do
table.insert(finishedTable, tonumber(int))
end
return finishedTable
end
Is there an easier/more effective way of going about this? Thanks!

1 comment
Roblox already JSONEncodes the datastore requests.