EnvironmentOverview
saveinstance
Represents serialization of runtime object data.
Details#
Serializes the available game hierarchy into a workspace Lua file and returns a write-success boolean. The default filename is savefile.lua; pass a filename string or a second-argument options table with FileName to select another path. Passing a Folder does not restrict the serialized hierarchy to that folder. The output is a partial object representation, not a complete executable backup.
Examples#
Example
local path = "docs-hierarchy-export.lua"
assert(not isfile(path), "Export file already exists")
local ok = saveinstance(path)
print("Export written:", ok)