-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Save instances in a place as individual model files example shows us this:
local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
-- Here we load a file just like in the first example
local file = fs.readFile("myPlaceFile.rbxl")
local game = roblox.deserializePlace(file)
local workspace = game:GetService("Workspace")
-- Make sure a directory exists to save our models in
fs.writeDir("models")
-- Then we save all of our instances in Workspace as model files, in our new directory
-- Note that a model file can actually contain several instances at once, so we pass a table here
for _, child in workspace:GetChildren() do
file = roblox.serializeModel({ child })
fs.writeFile("models/" .. child.Name, file)
end
I believe it should be fs.writeFile("generated/" .. child.Name .. ".rbxm", file)
and contain the .rbxm
extension for this files to be usable.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation