I am saving a table into a datastore, which creates 2 keys, in my datastore, but when I save the table again it prints out the only two keys again…
Should be:
-- [1] --> sword
-- [2] --> 34
-- [3] --> sword
-- [4] -- > 34
Is:
-- [1] --> sword
-- [2] --> 34
Code:
local function saveSellOrder(player, sellOrderSaveValues)
local userId = player.UserId
local key = "Player_" .. userId
if player and sellOrderSaveValues then
local success, errorMessage = pcall(function()
testDataStore:SetAsync(key, sellOrderSaveValues)
end)
if not success then
print(errorMessage)
end
local success, currentExperience = pcall(function()
return testDataStore:GetAsync(key)
end)
if success then
print(currentExperience)
end
end
end