Examples

These are a few examples of things you can do using the built-in roblox library.

1 - Make all parts anchored in a place file

local roblox = require("@lune/roblox")

-- Read the place file called myPlaceFile.rbxl into a DataModel called "game"
-- This works exactly the same as in Roblox, except "game" does not exist by default - you have to load it from a file!
local game = roblox.readPlaceFile("myPlaceFile.rbxl")
local workspace = game:GetService("Workspace")

-- Make all of the parts in the workspace anchored
for _, descendant in workspace:GetDescendants() do
	if descendant:IsA("BasePart") then
		descendant.Anchored = true
	end
end

-- Save the DataModel (game) back to the file that we read it from
roblox.writePlaceFile("myPlaceFile.rbxl")

2 - Save instances in a place as individual model files


3 - Make a new place from scratch

Last updated