How to make a data store with tables?
Asked by
7 years ago Edited 7 years ago
I need a data store that has three tables in it. I have this so far. I don't know how to make it so that it saved tables.
01 | local DATA = game:GetService( "DataStoreService" ):GetDataStore( "SaveNames" ); |
03 | game.Players.PlayerAdded:connect( function (player) |
04 | local blocks = Instance.new( "Folder" , player) |
05 | local names = Instance.new( "StringValue" , blocks) |
06 | local positions = Instance.new( "IntValue" , blocks) |
07 | local sizes = Instance.new( "IntValue" , blocks) |
08 | blocks.Name = "Blocks" |
10 | positions.Name = "Positions" |
12 | if DATA:GetAsync(player.userId) then |
13 | names.Value = DATA:GetAsync(player.userId) [ 1 ] |
14 | positions.Value = DATA:GetAsync(player.userId) [ 2 ] |
15 | sizes.Value = DATA:GetAsync(player.userId) [ 3 ] |
19 | game.Players.PlayerRemoving:connect( function (player) if player:FindFirstChild( "Blocks" ) then |
20 | DATA:GetAsync(player.userId, { player.Blocks.Names.Value, player.Blocks.Positions.Value, player.Blocks.Sizes.Value } ) |