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

How do I DataStore a table?

Hi. I've been recently trying to save progress for a region of terrain. I use ReadVoxels so I convert the region of smooth terrain into table format. My question is though, how exactly do I datastore this table?

Any comments/answers will help.

~SkeletalReality

1 answer

local player= game.Players.LocalPlayer
SaveDat = game:GetService("DataStoreService"):GetOrderedDataStore(player.Name.." Terrain")   

For I,v in pairs(TerrainTables) do -- go through the terrain table setting save data values to the same as the table.
-- add warn(i) and
-- add print(v) if you want to see what the table looks like
SaveDat :SetAsync(i, v)
end

1 comment

0

Well tbh, Player.Name is a bad idea. You should use the player ID, because people can change their name

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