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: Difficulties setting values to a table with datastores

Previous Thread :: Next Thread 
llaserx is not online. 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 is not online. 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 is not online. 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 is not online. llaserx
Joined: 10 Dec 2011
Total Posts: 53069
01 Sep 2016 02:34 AM
Well dats bad
Report Abuse
llaserx is not online. llaserx
Joined: 10 Dec 2011
Total Posts: 53069
01 Sep 2016 01:28 PM
b


r+://290739801r+://290739819r+://290739831
Report Abuse
Raphael7 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. llaserx
Joined: 10 Dec 2011
Total Posts: 53069
01 Sep 2016 02:47 PM
IIdont see much help here qq
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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 is not online. 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 is not online. 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
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