So I'm trying to save this table with tables inside of it with part data but anytime I try to run SetAsync it 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)

4 comments

0

What's in "FinalString1"? Can you give us an example of what might be inside it?

0

local FinalString1 = {{"BuildingStatus",true},{"Visible",false}}

0

You could be making the meta table wrong. Hers

0