Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 17 Jul 2015 09:52 AM |
With datastores, I know you can store Lua tables.
Can these tables contain other tables and so on? - basically allowing for unlimited storage of data? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 17 Jul 2015 09:54 AM |
"basically allowing for unlimited storage of data?"
:l |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 17 Jul 2015 10:07 AM |
If datastore tables can contain other tables, it allows you to store as much data as you want.
But can they? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 17 Jul 2015 10:48 AM |
Having tables inside a table doesn't mean you have unlimited storage.
I was told DataStore can't store 'complex' tables. So try this; it converts a table to a string, and vise-versa.
local ds=game:GetService'DataStoreService':GetDataStore'Test' local http=game:GetService'HttpService'
function SaveTable(table) local encoded=http:JSONEncode(table) ds:SetAsync('YourTable',encoded) end function LoadTable(key) if ds:GetAsync(key) then local encoded=ds:GetAsync(key) local decoded=http:JSONDecode(encoded) return decoded end end
Make sure you enable Http requests in your game. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2015 10:55 AM |
| DataStore CAN save tables and those tables CAN have tables in them. But it's automatically converted into a string (and back to a table when getting it) and therefore does have a data limit. |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|