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
 

Help with datastores!

Previous Thread :: Next Thread 
SectionOne is not online. SectionOne
Joined: 12 Mar 2010
Total Posts: 3783
06 Apr 2016 08:41 PM
So I'm trying to save a table on datastore (data={kills=0,deaths=0,level=0}
Upon trying to print, it returns few irrelevant numbers and few letters, is there something wrong?
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
06 Apr 2016 08:45 PM
The table is encoded, it says something like "table: abc123"?

Try doing JsonDecode if you have httpservice enabled, or just do something like this:

for i = 1,#table do
print(table[i])
end

Someone correct me if there's a better way to print everything in a table, because this feels really inefficient to me.
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
06 Apr 2016 08:46 PM
Oops, I meant JSONEncode.
Report Abuse
SectionOne is not online. SectionOne
Joined: 12 Mar 2010
Total Posts: 3783
06 Apr 2016 08:47 PM
Ah, alright thanks!
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
06 Apr 2016 08:48 PM
Oh, to answer the second part of your question: No, there's nothing wrong. It's supposed to do that.
Report Abuse
regentia is not online. regentia
Joined: 07 Feb 2011
Total Posts: 66
06 Apr 2016 08:51 PM
you could do it like

print(unpack(data)) or print(table.concat(data,", "))

but you wouldn't see the table's keys which would make recognizing the data harder

this is also a viable option

for i,v in next,data do
print(tostring(i)..": ",v)
end
Report Abuse
regentia is not online. regentia
Joined: 07 Feb 2011
Total Posts: 66
06 Apr 2016 08:53 PM
never mind the first methods i showed you, they only work with keys that are integers
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