{ -- Array
{ -- Table
AssetId = <Integer>, -- for use with InsertService::LoadAsset()
AssetSetId = <Integer>, -- source set
AssetVersionId = <Integer>, -- for use with
InsertService::LoadAssetVersion()
IsTrusted = <Integer>, -- "trusted" flag
Name = <String>, -- model name
CreatorName = <String> -- creator name
}
}
```lua
local InsertService = game:GetService("InsertService")
local set = InsertService:GetBaseSets()[1]
local list = InsertService:GetCollection(set["CategoryId"])
print(list)
```
### Method: InsertService:GetFreeDecals
**Signature:** `InsertService:GetFreeDecals(searchText: string, pageNum: int): Array`
Retrieves a list of free Decals from the Catalog.
*Yields · Security: None · Thread Safety: Unsafe · Capabilities: AssetRead*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `searchText` | `string` | | String used to search for free decals in the Catalog. |
| `pageNum` | `int` | | The page number in the Catalog to return. |
**Returns:** `Array` — A single table (of returned free decals) wrapped in a table.
**InsertService:GetFreeDecalsAsync**
```lua
local InsertService = game:GetService("InsertService")
local page = unpack(InsertService:GetFreeDecalsAsync("Cats", 0)) -- Search for "Cats" on Page 1.
for i = 1, page.TotalCount do
local item = page.Results[i]
print("Item #" .. i)
for key, value in pairs(item) do
print(" " .. key .. ": " .. value)
end
end
```
### Method: InsertService:GetFreeModels
**Signature:** `InsertService:GetFreeModels(searchText: string, pageNum: int): Array`
Retrieves a list of Free Models from the Catalog.
*Yields · Security: None · Thread Safety: Unsafe · Capabilities: AssetRead*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `searchText` | `string` | | String used to search for free models in the Catalog. |
| `pageNum` | `int` | | The page number in the Catalog to return. |
**Returns:** `Array` — A single table (of returned free models) wrapped in a table.
**InsertService:GetFreeModelsAsync**
```lua
local InsertService = game:GetService("InsertService")
local page = unpack(InsertService:GetFreeModelsAsync("Cats", 0)) -- Search for "Cats" on Page 1.
for i = 1, page.TotalCount do
local item = page.Results[i]
print("Item #" .. i)
for key, value in pairs(item) do
print(" " .. key .. ": " .. value)
end
end
```
### Method: InsertService:GetUserCategories
**Signature:** `InsertService:GetUserCategories(userId: User): Array`
> **Deprecated:** This item is deprecated. Do not use it for new work.
*Yields · Security: None · Thread Safety: Unsafe*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `userId` | `User` | | |
**Returns:** `Array`
### Method: InsertService:GetUserSets
**Signature:** `InsertService:GetUserSets(userId: User): Array`
> **Deprecated:** [Sets have been removed](https://devforum.roblox.com/t/sunsetting-sets/189402) from Roblox.
Returns an array of dictionaries, containing information about sets owned
by the user. This includes
- Sets the user is subscribed to.
- Sets that the user created.
- A single set containing the models created by the user.
- A single set containing the decals created by the user.
Note:
- All values in the dictionaries are
strings, even if they are a
number.
| Name | Description |
| --- | --- |
| Name | The name of the set. |
| Description | The description of the set. |
| ImageAssetId | An assetId for the icon of the set. |
| CreatorName | The creator of the set. |
| AssetSetId | The set's unique ID on the website. |
| CategoryId | Identical to AssetSetId |
| SetType | The type of set that this set is. |
*Yields · Security: None · Thread Safety: Unsafe*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `userId` | `User` | | |
**Returns:** `Array`
### Method: InsertService:Insert
**Signature:** `InsertService:Insert(instance: Instance): ()`
> **Deprecated:** This function has been superseded by [InsertService:LoadAsset()](/docs/reference/engine/classes/InsertService.md) which should be used in all new work.
This function is a legacy method used to insert an [Instance](/docs/reference/engine/classes/Instance.md) into
[Workspace](/docs/reference/engine/classes/Workspace.md).
*Security: None · Thread Safety: Unsafe*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `instance` | `Instance` | | |
**Returns:** `()`
**InsertService:Insert**
```lua
local InsertService = game:GetService("InsertService")
local ASSET_ID = 123456789
local instance = InsertService:LoadAsset(ASSET_ID)
if instance then
InsertService:Insert(instance)
end
```
### Method: InsertService:loadAsset
**Signature:** `InsertService:loadAsset(assetId: int64): Instance`
> **Deprecated:** This function is a deprecated variant of [InsertService:LoadAsset()](/docs/reference/engine/classes/InsertService.md) which should be used instead.
*Yields · Security: None · Thread Safety: Unsafe · Capabilities: LoadOwnedAsset*
**Parameters:**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `assetId` | `int64` | | |
**Returns:** `Instance`
## Inherited Members
### From [Instance](/docs/reference/engine/classes/Instance.md)
- **Property `Archivable`** (`boolean`): Determines if an Instance and its descendants can be cloned using
- **Property `archivable`** (`boolean`): *(deprecated, hidden)*
- **Property `Capabilities`** (`SecurityCapabilities`): The set of capabilities allowed to be used for scripts inside this
- **Property `Name`** (`string`): A non-unique identifier of the Instance.
- **Property `Parent`** (`Instance`): Determines the hierarchical parent of the Instance.
- **Property `PredictionMode`** (`PredictionMode`):
- **Property `RobloxLocked`** (`boolean`): A deprecated property that used to protect CoreGui objects. *(hidden)*
- **Property `Sandboxed`** (`boolean`): When enabled, the instance can only access abilities in its `Capabilities`
- **Property `UniqueId`** (`UniqueId`): A unique identifier for the instance.
- **Method `AddTag(tag: string): ()`**: Applies a tag to the instance.
- **Method `children(): Instances`**: Returns an array of the object's children. *(deprecated)*
- **Method `ClearAllChildren(): ()`**: This method destroys all of an instance's children.
- **Method `Clone(): Instance`**: Create a copy of an instance and all its descendants, ignoring instances
- **Method `clone(): Instance`**: *(deprecated)*
- **Method `Destroy(): ()`**: Sets the Instance.Parent property to `nil`, locks the
- **Method `destroy(): ()`**: *(deprecated)*
- **Method `FindFirstAncestor(name: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorOfClass(className: string): Instance?`**: Returns the first ancestor of the Instance whose
- **Method `FindFirstAncestorWhichIsA(className: string): Instance?`**: Returns the first ancestor of the Instance for whom
- **Method `FindFirstChild(name: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance found with the given name.
- **Method `findFirstChild(name: string, recursive?: boolean): Instance`**: *(deprecated)*
- **Method `FindFirstChildOfClass(className: string): Instance?`**: Returns the first child of the Instance whose
- **Method `FindFirstChildWhichIsA(className: string, recursive?: boolean): Instance?`**: Returns the first child of the Instance for whom
- **Method `FindFirstDescendant(name: string): Instance?`**: Returns the first descendant found with the given Instance.Name.
- **Method `GetActor(): Actor?`**: Returns the Actor associated with the Instance, if any.
- **Method `GetAttribute(attribute: string): Variant`**: Returns the value which has been assigned to the given attribute name.
- **Method `GetAttributeChangedSignal(attribute: string): RBXScriptSignal`**: Returns an event that fires when the given attribute changes.
- **Method `GetAttributes(): Dictionary`**: Returns a dictionary of the instance's attributes.
- **Method `GetChildren(): Instances`**: Returns an array containing all of the instance's children.
- **Method `getChildren(): Instances`**: *(deprecated)*
- **Method `GetDebugId(scopeLength?: int): string`**: Returns a coded string of the debug ID used internally by Roblox.
- **Method `GetDescendants(): Instances`**: Returns an array containing all of the descendants of the instance.
- **Method `GetFullName(): string`**: Returns a string describing the instance's ancestry.
- **Method `GetStyled(name: string, selector: string?): Variant`**: Returns the styled or explicitly modified value of the specified property,
- **Method `GetStyledPropertyChangedSignal(property: string): RBXScriptSignal`**:
- **Method `GetTags(): Array`**: Gets an array of all tags applied to the instance.
- **Method `HasTag(tag: string): boolean`**: Check whether the instance has a given tag.
- **Method `IsAncestorOf(descendant: Instance): boolean`**: Returns true if an Instance is an ancestor of the given
- **Method `IsDescendantOf(ancestor: Instance): boolean`**: Returns `true` if an Instance is a descendant of the given
- **Method `isDescendantOf(ancestor: Instance): boolean`**: *(deprecated)*
- **Method `IsPropertyModified(property: string): boolean`**: Returns `true` if the value stored in the specified property is not equal
- **Method `QueryDescendants(selector: string): Instances`**: Returns an array containing all descendants of the instance that match the
- **Method `Remove(): ()`**: Sets the object's `Parent` to `nil`, and does the same for all its *(deprecated)*
- **Method `remove(): ()`**: *(deprecated)*
- **Method `RemoveTag(tag: string): ()`**: Removes a tag from the instance.
- **Method `ResetPropertyToDefault(property: string): ()`**: Resets a property to its default value.
- **Method `SetAttribute(attribute: string, value: Variant): ()`**: Sets the attribute with the given name to the given value.
- **Method `WaitForChild(childName: string, timeOut: double): Instance`**: Returns the child of the Instance with the given name. If the
- **Event `AncestryChanged`**: Fires when the Instance.Parent property of this object or one of
- **Event `AttributeChanged`**: Fires whenever an attribute is changed on the Instance.
- **Event `ChildAdded`**: Fires after an object is parented to this Instance.
- **Event `childAdded`**: *(deprecated)*
- **Event `ChildRemoved`**: Fires after a child is removed from this Instance.
- **Event `DescendantAdded`**: Fires after a descendant is added to the Instance.
- **Event `DescendantRemoving`**: Fires immediately before a descendant of the Instance is removed.
- **Event `Destroying`**: Fires immediately before (or is deferred until after) the instance is
- **Event `StyledPropertiesChanged`**: Fires whenever any style property is changed on the instance, including
### From [Object](/docs/reference/engine/classes/Object.md)
- **Property `ClassName`** (`string`): A read-only string representing the class this Object belongs to.
- **Property `className`** (`string`): *(deprecated)*
- **Method `GetPropertyChangedSignal(property: string): RBXScriptSignal`**: Get an event that fires when a given property of the object changes.
- **Method `IsA(className: string): boolean`**: Returns true if an object's class matches or inherits from a given class.
- **Method `isA(className: string): boolean`**: *(deprecated)*
- **Event `Changed`**: Fires immediately after a property of the object changes, with some
| Label 1 | Label 2 | Label 3 |
| Label 4 | Label 5 | Label 6 |
| Label 7 | Label 8 | Label 9 |
Main Menu
``` ```lua local rule = Instance.new("StyleRule") rule.Parent = coreSheet rule.Selector = "ImageLabel, TextLabel" -- Selector for image labels AND text labels rule:SetProperty("BackgroundColor3", Color3.fromHex("ff0033")) -- Create image label local imageLabel = Instance.new("ImageLabel") imageLabel.Image = "rbxassetid://104919049969988" imageLabel.Size = UDim2.new(0, 100, 0, 100) imageLabel.Parent = screenGui -- Create text label local textLabel = Instance.new("TextLabel") textLabel.Size = UDim2.new(1, 0, 0, 0) textLabel.AutomaticSize = Enum.AutomaticSize.Y textLabel.TextXAlignment = Enum.TextXAlignment.Left textLabel.TextYAlignment = Enum.TextYAlignment.Top textLabel.Text = "Main Menu" textLabel.Parent = screenGui ``` ## Pseudo-classes The Roblox equivalent to CSS [pseudo-class](https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes) selectors are **state selectors** which correspond to one of the four `Enum.GuiState` values such as `Enum.GuiState|Hover` or `Enum.GuiState|Press`. ```text img:hover { opacity: 0.5; } ``` ```text
```
```lua
local rule = Instance.new("StyleRule")
rule.Parent = coreSheet
rule.Selector = "ImageLabel:Hover" -- State selector
rule:SetProperty("ImageTransparency", 0.5)
-- Create image label
local imageLabel = Instance.new("ImageLabel")
imageLabel.Image = "rbxassetid://104919049969988"
imageLabel.Size = UDim2.new(0, 100, 0, 100)
imageLabel.BackgroundTransparency = 1
imageLabel.Parent = screenGui
```
## Pseudo-instances
Similar to how CSS [pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements) can modify specific parts of an element, Roblox can create phantom `Class.UIComponent|UIComponents` through a style rule's `Class.StyleRule.Selector|Selector` property. For example, the following rule effectively creates a `Class.UICorner` modifier under every `Class.Frame` tagged with `RoundedCorner20` and sets each modifier's `Class.UICorner.CornerRadius|CornerRadius` to `20` pixels.
```lua
local rule = Instance.new("StyleRule")
rule.Parent = coreSheet
rule.Selector = "Frame.RoundedCorner20::UICorner" -- UI component selector
rule:SetProperty("CornerRadius", UDim.new(0, 20))
-- Create frame
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.4, 0, 0.2, 0)
frame.Parent = screenGui
-- Apply tag to frame
CollectionService:AddTag(frame, "RoundedCorner20")
```
## Queries
Roblox **style queries** bridge the gap between CSS [media queries](https://developer.mozilla.org/docs/Web/CSS/CSS_media_queries) and [container queries](https://developer.mozilla.org/docs/Web/CSS/CSS_containment/Container_queries). Using the `@` prefix, you can toggle styles based on parent dimensions, input device types, or user accessibility settings.
In CSS, `@container` applies styles based on the size of a parent element. In Roblox, you define a pseudo‑instance query using `::StyleQuery` followed by an [identifier](#identifier) for the condition's `Class.StyleRule.Selector|Selector` property, for example
`"::StyleQuery #WideContainer"`
, alongside a `Class.StyleQuery` condition name like `"MinSize"` to evaluate the parent's `Class.GuiObject.AbsoluteSize`. Then, to apply styles to the instance or its children when the query is active, create a `Class.StyleRule` with the `@[identifier]` prefix as its `Class.StyleRule.Selector|Selector`, for example `@WideContainer`.
```text
.container {
container-type: inline-size;
background-color: rgba(0, 0, 34, 0.5);
}
button {
background-color: #335FFF;
color: #E1E1E1;
width: 75%;
height: 40px;
border: none;
}
@container (min-width: 400px) {
button {
background-color: #cc0033;
}
}
```
```text
A response model specific to multi-get user.
Note: Currently the MultiGet responses don't have all the data that the single gets have, to reduce payload size! We might want to revisit this decision in the future.
| Property | Type | Required | Description | |----------|------|----------|-------------| | `hasVerifiedBadge` | `boolean` | No | The user's verified badge status. | | `id` | `integer` | No | The user Id. | | `name` | `string` | No | The user name. | | `displayName` | `string` | No | The user DisplayName. | ### Roblox.Users.Api.SearchGetUserResponse A user response model specific to getting a user from user search. | Property | Type | Required | Description | |----------|------|----------|-------------| | `previousUsernames` | `string[]` | No | Previous usernames for a user. | | `hasVerifiedBadge` | `boolean` | No | The user's verified badge status. | | `id` | `integer` | No | The user Id. | | `name` | `string` | No | The user name. | | `displayName` | `string` | No | The user DisplayName. | ### Roblox.Users.Api.SetDisplayNameRequest Request model for changing a display name. | Property | Type | Required | Description | |----------|------|----------|-------------| | `newDisplayName` | `string` | No | The users new display name. | ### Roblox.Users.Api.UserAgeBracketResponse A user age bracket response model. | Property | Type | Required | Description | |----------|------|----------|-------------| | `ageBracket` | `integer` | No | The age bracket of the user. | ### Roblox.Users.Api.UserCountryCodeResponse A user country code response model. | Property | Type | Required | Description | |----------|------|----------|-------------| | `countryCode` | `string` | No | The country code of the user. | ### Roblox.Users.Api.UserRolesResponse A user roles response model. | Property | Type | Required | Description | |----------|------|----------|-------------| | `roles` | `string[]` | No | The roles of the user. | ### Roblox.Users.Api.UsernameHistoryResponse | Property | Type | Required | Description | |----------|------|----------|-------------| | `name` | `string` | No | A past username belonging to a particular userId | ### Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Users.Api.MultiGetUserByNameResponse] | Property | Type | Required | Description | |----------|------|----------|-------------| | `data` | `Roblox.Users.Api.MultiGetUserByNameResponse[]` | No | | ### Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Users.Api.MultiGetUserResponse] | Property | Type | Required | Description | |----------|------|----------|-------------| | `data` | `Roblox.Users.Api.MultiGetUserResponse[]` | No | | ### Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Users.Api.SearchGetUserResponse] | Property | Type | Required | Description | |----------|------|----------|-------------| | `previousPageCursor` | `string` | No | | | `nextPageCursor` | `string` | No | | | `data` | `Roblox.Users.Api.SearchGetUserResponse[]` | No | | ### Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Users.Api.UsernameHistoryResponse] | Property | Type | Required | Description | |----------|------|----------|-------------| | `previousPageCursor` | `string` | No | | | `nextPageCursor` | `string` | No | | | `data` | `Roblox.Users.Api.UsernameHistoryResponse[]` | No | |