create_instance
Creates a new Roblox instance with only engine default properties.
What it does
create_instance makes a new instance — Part, Script, LocalScript, ModuleScript, ScreenGui, Frame, TextButton, RemoteEvent, Folder, and so on — under a chosen parent. It deliberately takes no property overrides: the resulting instance has engine defaults, and Revix configures it afterward.
The expected workflow is two steps. First, call create_instance to make the instance. Then, depending on what was made, call set_properties to configure values like Size and Anchored, write_script to set initial source for a script, or execute_command for anything specialized. Splitting create from configure keeps the action history clean and makes property changes individually undoable.
create_instance returns the full DataModel path of the new instance, which Revix uses as the path for follow-up calls.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| `class_name` | string | yes | Roblox class name (e.g. `Part`, `Script`, `Frame`, `ScreenGui`, `RemoteEvent`, `Folder`). |
| `parent` | string | yes | DataModel path to the parent (e.g. `Workspace`, `ServerScriptService`, `StarterGui/MainMenu`). |
| `name` | string | no | Name for the instance. Defaults to the class name. |
When Revix uses it
- Adding a new script, folder, or part to the game
- Building UI hierarchies element-by-element (when
render_uiis not appropriate) - Setting up
RemoteEvents,BindableEvents, or other service plumbing - Creating containers (
Folder,Configuration) before populating them
Example
create_instance(class_name="Script", parent="ServerScriptService", name="GameManager")
=> ServerScriptService/GameManagerTroubleshooting
If creation appears to silently do nothing, check that the parent path resolves to an existing instance. For the full create-then-configure pattern, see building instances.