Need help with Tables to String / String to Tables

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

I recommend using JSON to do so.

3 Likes

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

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

oh thats sick i didnt know about both those until now
and yes i just want that table to be stored inside stringvalue

Just bear in mind that StringValues have a 200k character limit!

1 Like

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