for i, v in pairs(valuesToStore) do
	if i < 4 then
		print(valuesToStore[i])
	else
		for k, n in pairs(v) do
			for b, m in pairs(n) do
				print(m)
			end
		end
	end
end

local savedState = DS:GetAsync(key)

local success, errormessage = pcall(function()
	DS:SetAsync(key, valuesToStore)
end)

if success then
	print("Data Saved")
else
	print("Data failed")
end

Can anyone explain why the bottom block, the pcall and the success test, doesn't work, but the top one does? I used the top bit to test if valuesToStore is working and it is, it's an array that, except for the first 3 elements, is filled with arrays. Please comment if the question isn't clear enough and I'll do my best to attempt to explain it better.

3 comments

0

Share the content of valuesToStore and print out the error message

0

There are over 300 lines, if I print each part of the valuesToStore on one line and there is no error message.

0

Try printing something before and after the "DS:SetAsync()" function to test whether or not its stuck trying to send the data.