|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|