I made a data store system for a crate system in my game, and everything has been fine. However, recently I’ve been getting errors, even though I haven’t touched the script at all and everything looks fine.
I either get one of these two errors:
When I get the first error, my data still saves. However, when I get the second error my data doesn’t save.
Here is the bugged part:
local inventory = {}
for _, item in pairs(plr:WaitForChild("Emotes"):GetChildren()) do
table.insert(inventory, item.Name)
end
if playersUnboxing[plr] then
table.insert(inventory, playersUnboxing[plr])
end
local compiledData = {
Inventory = inventory;
Equipped = plr.EmoteEquipped.Value
}
local success, err = nil, nil
while not success do
success, err = pcall(function()
ds:SetAsync(plr.UserId, compiledData)
end)
if err then
warn("Data Store |",err)
elseif success then
print("Data Store | Emote data saved for "..plr.Name)
end
task.wait(.5)
end
If you have any tips that would be greatly appreciated!