I have a table and I want to write it perfectly in a given module script’s table via command line, how would I do this?
I know I need to set the moduleScript.Source
I have a table and I want to write it perfectly in a given module script’s table via command line, how would I do this?
I know I need to set the moduleScript.Source
What kind of data is stored in that table? If it’s only primitive data and other tables (nil, bool, number, string), you can create a recursive function that builds a string using that data. If it contains userdata or global variables, you must account for those individually (for example, if typeof(val) == "Vector3" then src = src .. "Vector3.new(" .. val.X .. "," .. val.Y .. "," .. val.Z .. ") end
. And if you must support cyclic tables or userdata that is dynamically generated using the table contents (for example, OOP classes in some implementations), you should probably create a serializer that is specifically meant to be used with your data.