Hi!
i am making a plugin and I need to serialize tables so that they can be used within scripts but i want to do that dynamically
example
-- the table i want to serialize dynamiclly
local data = {
Part = {
["Position"] = {50,50,50},
["Color"] = {255,255,255}
},
Frame = {
["Udmi2"] = {1,0,1,0},
["BackgroundColor3"] = {255,255,255}
}
}
--serializing the table
for _, instanceName in data do
for property, value in instanceName do
local ins = Instance.new(instanceName) -- Instance.new is used to extract the properties type
local propertyType = typeof(ins[property])
--I need help here
data[instanceName][property] = propertyType.new(table.unpack(value)) -- this isnot correct and i need help here
end
end
now I can make a table with the existing data types but that is time consuming, and I don’t want to update the plugin if Roblox added a new data type