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

Data isn't saving while not erroring! why?

Asked by 4 years ago
01local DS = game:GetService("DataStoreService")
02local InventoryStore = DS:GetDataStore("InventoryStore")
03local function save(player)
04    local playerInventory = player.Inventory:GetChildren()
05    local playerSave = {}
06    for i = 1, #playerInventory do
07        print(playerInventory[i].Value)
08        table.insert(playerSave, playerInventory[i].Value)
09    end
10    local success, failure = pcall(function()
11        InventoryStore:SetAsync(player.UserId, playerSave)
12    end)
13    if success then
14        print("Saving Success!")
15    end
View all 38 lines...

This code isn't erroring nor saving the Player's data.

Answer this question