llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 01:04 AM |
so i a table set up like, the saving on it works great
local vals = {--All below are intvalues plrstats.Hair, plrstats.Hair2, plrstats.Face, plrstats.Shirt, plrstats.Pants, plrstats.SkinColor, plrstats.Accessory1, plrstats.Accessory2, plrstats.Accessory3, plrstats.Accessory4, plrstats.Accessory5, plrstats.Color1, plrstats.Color2, }
my problem is when i have to load values into the table my current method doesnt go well when any table value contains double values and only applies single digits then disregards the left over
my table which holds the data looks like this {000000000000,0000000000000,000000000000} each one holds a different set of values
my loading method is this local stats = saves[id] local currstats = table.concat(valholder) if data == "load" then print 'loading' local loaded = string.gsub(currstats,currstats,stats) local tab = {} for i = 1,#vals do table.insert(tab,i,string.sub(loaded,i,i)) end for i,v in pairs(vals) do vals[i].Value = tab[i] end end like i said this method only applies single digits towards each value then disregards the rest help pls
r+://290739801r+://290739819r+://290739831 |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 02:04 AM |
do i neeed to give mor info qq
r+://290739801r+://290739819r+://290739831 |
|
|
| Report Abuse |
|
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 01 Sep 2016 02:07 AM |
| No it's just no one cares to help you right now. |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
| |
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 01:28 PM |
b
r+://290739801r+://290739819r+://290739831 |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 01 Sep 2016 01:30 PM |
| If these are objects, DataStores doesn't save objects. |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 01 Sep 2016 01:32 PM |
Curious, why do you save it like this?
"my table which holds the data looks like this {000000000000,0000000000000,000000000000} each one holds a different set of values" |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 01:43 PM |
i said my saving already worked fine by that meaning i converted the objects values into a table a saved it -______________--
i set my data like that because there suppose to represent 3 slots
r+://290739801r+://290739819r+://290739831 |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 01 Sep 2016 02:07 PM |
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=195621950
|
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 02:47 PM |
| IIdont see much help here qq |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2016 03:28 PM |
why cant you just do
local data = { color = {a;b;c}; functions = {a;b;c}; junk = {a;b;c={d;e;f}}; }
example |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2016 03:31 PM |
Or just to be safe I guess you could distinguish each in a table like stated above ^ and convert all values being stored to strings, and then decode it based on it's table. I've never really had an issue like this.
#code Signature_mod = require(DataModel['sm_Data']) if Signature_mod['xThe..']['RbxDev_Info'] ~= 'Too Lazy To Try Again After A Year' then print('You finally did it lol') end |
|
|
| Report Abuse |
|
|
|
| 01 Sep 2016 03:35 PM |
| using a dictionary should be easier for you unless you are making something that saves something like skins for a player (like in my game can save your pixelated skins and load them for the next server) |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 01 Sep 2016 04:29 PM |
I was thinking about using tables inside tables But then i havw to rethink my save systrm |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 01 Sep 2016 06:49 PM |
If you're trying to encode your table, just use JSONEncode and JSONDecode.
And with your table you could change it to something like this;
local data = { ['Character1'] = { ['Name'] = 'Bob', ['Hair'] = {'link', 'link2'}, ['Shirt'] = '' ['Accessories'] = {game.Players.LocalPlayer.Backpack:GetChildren()} } }
save = game:GetService('HttpService'):JSONEncode(data) |
|
|
| Report Abuse |
|
|