generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: DataStore question

Previous Thread :: Next Thread 
Ultraw is online. 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 is not online. 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 is online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
17 Jul 2015 10:12 AM
You can't be serious.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is online. Ultraw
Joined: 20 Nov 2010
Total Posts: 6575
18 Jul 2015 02:15 AM
Thanks cooldude
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image