What to do with my old game if the Roblox's Table-saving DataStore is deprecated?
So I have an old survival game back in 2017, I've created a DataStore script that saves tables:
You may have the full script here:
01 | local Storage = game:GetService( 'ReplicatedStorage' ) |
02 | local ItemsFolder = Storage:WaitForChild( 'ItemsFolder' ) |
03 | local DataStoreService = game:GetService( "DataStoreService" ) |
04 | local InventoryData = DataStoreService:GetDataStore( "PlayerInventory" ) |
06 | for i,item in pairs (ItemsFolder:GetChildren()) do |
07 | table.insert(ItemsList,item.Name) |
10 | game.Players.PlayerAdded:connect( function (plr) |
11 | local scope = "Player_" ..plr.UserId |
12 | local InvFolder = Instance.new( 'Folder' ) |
13 | InvFolder.Name = "InventoryFolder" |
17 | local Newvalue = Instance.new( "IntValue" ) |
18 | Newvalue.Name = ItemsList [ i ] |
19 | table.insert(PlrItemObj,Newvalue) |
20 | Newvalue.Parent = InvFolder |
23 | local DataFile = InventoryData:GetAsync(scope) |
26 | for i = 1 ,#PlrItemObj do |
27 | print ( "Name: " ..PlrItemObj [ i ] .Name.. " / Value:" ..PlrItemObj [ i ] .Value) |
28 | PlrItemObj [ i ] .Value = DataFile [ i ] |
32 | for i = 1 ,#PlrItemObj do |
33 | table.insert(DataToSave,PlrItemObj [ i ] .Value) |
35 | InventoryData:SetAsync(scope,DataToSave) |
38 | InvFolder.Parent = plr |
At the line "PlrItemObj[i].Value = DataFile[i]"
I get this error "attempt to index local 'DataFile' (a number value)"
So is there another way to fix the DataStore?
P/s: If you're suggesting to save the data values one by one then you can't since the game have more than 100 items then it would throttle the firing due to limited DataStoreService requests.