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

SetAsync breaking script with no error?

Asked by
Edcorp 10
8 years ago

So I'm trying to save this table with tables inside of it with part data but anytime I try to run SetAsyncit just breaks it, I added a spawn(function() and it continues fine but doesn't print or save anything inside of it. This is the second week working on the same problem and quite frankly, I'm pissed.

local PartStoring = game:GetService("DataStoreService"):GetDataStore("TestPartsE")

game.Players.PlayerRemoving:connect(function(player)
    local key = "user_"..player.userId
    --FinalString1 is defined as a table with tables inside it containing part properties and stuff
    print('starting save') --Prints
    if FinalString1 then
        print('Before Saving') --Prints
        spawn(function() --If I don't have this it won't run the rest of the script
            PartStoring:SetAsync(key.."A",FinalString1) --Doesn't save
            print('saved 1') --Doesn't print
        end)
    end
end)
0
What's in "FinalString1"? Can you give us an example of what might be inside it? XAXA 1569 — 8y
0
local FinalString1 = {{"BuildingStatus",true},{"Visible",false}} Edcorp 10 — 8y
0
You could be making the meta table wrong. Hers User#11440 120 — 8y
0
Here an explanation on how mata table work, https://scriptinghelpers.org/blog/metatables-a-table-within-a-table-maybe-not User#11440 120 — 8y

Answer this question