Skip to main content
Creates a new Roblox instance with specified properties, attributes, and source code. This is ideal for creating fully configured objects in a single operation.

Endpoint

create_object_with_properties

Parameters

path
string
required
The path to the parent instance where the new object will be created.
className
string
required
The Roblox class name of the instance to create.
properties
object
Key-value pairs of properties to set on the new instance. Properties are applied using ValueSerializer to handle complex types.
attributes
object
Key-value pairs of attributes to set on the new instance. Supports typed values using the ValueSerializer format.
source
string
Source code to set (only applies to LuaSourceContainer instances like Script, LocalScript, ModuleScript).

Response

ok
boolean
Returns true if the object was created successfully.
path
string
The full path to the newly created object.
name
string
The name of the newly created object.
error
string
Error message if the operation failed.

Examples

Create a Part with Properties

{
  "path": "game.Workspace",
  "className": "Part",
  "properties": {
    "Name": "MyPart",
    "Anchored": true,
    "Color": {"type": "Color3", "value": [1, 0, 0]},
    "Size": {"type": "Vector3", "value": [10, 1, 10]}
  }
}
Response:
{
  "ok": true,
  "path": "Workspace.MyPart",
  "name": "MyPart"
}

Create a Script with Source Code

{
  "path": "game.ServerScriptService",
  "className": "Script",
  "properties": {
    "Name": "GameManager"
  },
  "source": "print('Game initialized!')\n\nlocal function initialize()\n\tprint('Starting game...')\nend\n\ninitialize()"
}
Response:
{
  "ok": true,
  "path": "ServerScriptService.GameManager",
  "name": "GameManager"
}

Create an Object with Attributes

{
  "path": "game.ReplicatedStorage",
  "className": "Configuration",
  "properties": {
    "Name": "GameSettings"
  },
  "attributes": {
    "MaxPlayers": 10,
    "GameMode": "Survival",
    "Difficulty": 5.5
  }
}
Response:
{
  "ok": true,
  "path": "ReplicatedStorage.GameSettings",
  "name": "GameSettings"
}

Create a Complex Object

{
  "path": "game.Workspace",
  "className": "MeshPart",
  "properties": {
    "Name": "SpawnPoint",
    "Anchored": true,
    "CanCollide": false,
    "Position": {"type": "Vector3", "value": [0, 10, 0]},
    "Transparency": 0.5
  },
  "attributes": {
    "SpawnID": 1,
    "TeamColor": "Blue",
    "IsActive": true
  }
}
Response:
{
  "ok": true,
  "path": "Workspace.SpawnPoint",
  "name": "SpawnPoint"
}

Notes

  • Properties are applied before the object is parented, ensuring all settings take effect
  • Invalid properties are silently ignored (wrapped in pcall)
  • For scripts, the source code is set before parenting
  • Use create_object for simple object creation without properties
  • For bulk creation, use mass_create_objects_with_properties

Build docs developers (and LLMs) love