Alvadus
(Xehanort)
November 21, 2019, 11:41am
#1
Hello, i started messing with string manipulations lately but the issue is i still can’t turn these multiple tables into string
what i want to do is store that in a string value when player leaves game and get it again when he joins back in a form of table but i don’t know how to start
1 Like
Kacper
(Kacper)
November 21, 2019, 12:05pm
#2
I recommend using JSON to do so.
3 Likes
Alvadus
(Xehanort)
November 21, 2019, 12:09pm
#3
i just tried but i got this
EDIT: oh wait it’s cuz the values inside that are nil my bad but otherwise it worked thanks
2 Likes
boatbomber
(Zack_Ovits)
November 21, 2019, 12:10pm
#4
Yup!
HttpService has :JSONEncode()
and :JSONDecode()
to make this a very easy process.
To turn the table into a string, pass it to the encoding function.
To turn that resultant string into a table, put it through the decoding function.
However, what’s your use case here? Why can’t you leave it as a table? Don’t DataStores accept them as valid data types?
2 Likes
Alvadus
(Xehanort)
November 21, 2019, 12:13pm
#5
oh thats sick i didnt know about both those until now
and yes i just want that table to be stored inside stringvalue
boatbomber
(Zack_Ovits)
November 21, 2019, 12:18pm
#6
Just bear in mind that StringValues have a 200k character limit!
1 Like
Alvadus
(Xehanort)
November 21, 2019, 12:21pm
#7
It’s ok that was just an example i’ll make sure to make those smaller thanks for the info
i tried both those functions and they perfectly worked fine thx again you and @Kacper (:
2 Likes