Builtin Library
README.md
scene.reload
Re-run a loaded scene's build.
Takes an optional scene name; without one the active root scene is rebuilt.
scene.load of a scene that is already loaded and unchanged is an
idempotent no-op, so editing an entrypoint and loading it again rebuilds
nothing. This unloads and re-loads the layer in place, running the
entrypoint's build again — in edit mode, so iterating on a build script
does not mean flipping to play and back through the play shadow.
A rebuild saves the scene, the way a write to build.luau does: scene.json
holds what the reload built, so the next play loads it, and unsaved edits in
the scene are saved with it. A library scene (under /libs/) is rebuilt in
the live scene alone, and its files stay as the library states them.
Returns { reloaded = <name>, built = true, content = n, editorOnly = n, saved = bool } once the layer has been rebuilt (saved is false for a
library scene), { reloaded = <name>, built = false, reason, message } when
the build did not run, or { error = "..." } when no matching layer is
loaded.