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 » Scripting Helpers
Home Search
 

Re: Data persistance [didnt mean to lock last post]

Previous Thread :: Next Thread 
textmasterthe9th is not online. textmasterthe9th
Joined: 03 Oct 2008
Total Posts: 752
15 Apr 2013 06:09 PM
I was reading through the wiki and I found this to save tables



Example Table:
mydata = {
score = 2,
level = 5,
admin = False,
name = "Player",
}


Saving Code:
local RbxUtility = LoadLibrary("RbxUtility")
player:SaveString('data', RbxUtility.EncodeJSON(mydata))

so I understand that but after saving a table like this how would you load it?
Report Abuse
MyTrade is not online. MyTrade
Joined: 14 Apr 2013
Total Posts: 160
15 Apr 2013 06:17 PM

player:LoadString('data', RbxUtility.EncodeJSON(mydata))



That moment when you get in the van...but there's no candy.
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
05 May 2013 08:56 PM
Sorry for the lateness of the post, but wouldn't it be:

player:WaitForDataReady()
if (player:LoadString("data") ~= nil) then
dat = player:LoadString("data")
decoded = RbxUtility.DecodeJSON(dat)

--[=[ WHATEVER YOU WANT TO DO WITH THE DECODED TABLE ("decoded") BELOW HERE ]=]--

end

That seems right, I haven't checked or looked it over so sorry if it errors.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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