I'm making a plugin and I'm trying to save a table as a setting. I'm pretty sure you can call :SetSetting() passing a table as a parameter, but it doesn't seem to work. Here's the code:
script.SaveSource.OnInvoke = function(source)
print("Saving source:",source.Name, "which is a", type(source))
savedSources[source.Name] = source
print("savedSources is a", type(savedSources), ", list of elements:")
for i, value in pairs(savedSources) do print(">", i, value) end
plugin:SetSetting(SETTING_KEY, savedSources)
local loaded = plugin:GetSetting(SETTING_KEY)
print("Loaded", loaded, " which is a ", type(loaded))
end
So, savedSources is a table which contains source objects, so I'm attempting to save the savedSources table as a setting for my plugin. But it doesn't seem to be working. Here's what it prints out when I try to save:
Saving source: asdfasdf which is a table
savedSources is a table, list of elements:
> asdfasdf table: 3590481C
Loaded nil which is a nil
As you can see, it has loaded nil, even though I have just saved a value.

2 comments
You can only save numbers/strings inside arrays in plugins (although numbers will be converted to strings) https://wiki.roblox.com/index.php?title=API:Class/Plugin/SetSetting
Well, that's bad