Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can i save tables to a datastore like so?

Asked by 5 years ago
Edited 5 years ago

I plan on setting up a table like this

local playerStuff = {
    gold = 0;
    fishCatches = {

    };
    inventory = {
    };  
    house = 0;
}

will this work saving that to a datastore? Or do i need to JSON it into one big string?

1 answer

Log in to vote
1
Answered by
Avigant 2374 Moderation Voter Community Moderator
5 years ago

Roblox handles the JSON encoding and decoding of values into DataStores. That is a legal table to save, yes!

0
ty my good sir! PoePoeCannon 519 — 5y
0
Do you mind me asking for any examples of a situation where player would want to encode and decode then? PoePoeCannon 519 — 5y
0
You might want to use JSON encoding and decoding for HttpService. Avigant 2374 — 5y
Ad

Answer this question