Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to save a table to a data store?

Yeah, that's it. The wiki is useless. Thanks for your help in advance.

2 comments

0

Just pass the table as the save value.

0

How?

1 answer

✓ Accepted answer
local DSService = game:GetService("DataStoreService")
local savedTable = DSService:GetDataStore("savedTable")
local table = {"One", "Two", "Three"}

savedTable:SetAsync("Key", table)

You save a table just as you would save any other value. Usually for the key I use the player's UserId so that every player has a unique key that their data is held in.

1 comment

0

Thanks! Glad to see a trusted scripter is always willing to help. :D

This discussion is preserved as it was. New answers, comments, and votes are closed.