Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
AssetService
Inherits from: Instance → Object
AssetService is a non-replicated service that handles asset-related queries to the Roblox web API.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service
Properties
| Name | Type / Returns | Description |
|---|---|---|
| AssetService.AllowInsertFreeAssets | boolean | Controls whether AssetService:LoadAssetAsync() can load assets that are not owned by the experience creator. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
AssetService.AllowInsertFreeAssets
This property can only be modified in Studio's Experience Settings by changing Allow Loading Third Party Assets.
When false (default), AssetService:LoadAssetAsync() can only load assets that meet one of the following:
- The asset must be created or owned by the game creator.
- The asset must be shared by the asset owner.
- The asset must be owned by Roblox.
When true, AssetService:LoadAssetAsync() can additionally load any public free asset on the Creator Store.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"RobloxScriptSecurity","write":"RobloxScriptSecurity"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
Methods
| Name | Type / Returns | Description |
|---|---|---|
| AssetService:ComposeDecalAsync | () | Modifies an existing Decal to contain a composite PBR textures created by layering the provided textures in the order they are provided in the layers array. Textures layer based on the alpha value of the color map. |
| AssetService:CreateAssetAsync | Tuple | Uploads a new asset to Roblox from the given object. |
| AssetService:CreateAssetVersionAsync | Tuple | Uploads a new version for an existing asset from the given object. |
| AssetService:CreateDataModelContentAsync | Tuple | Creates ephemeral, DataModel-scoped content from the provided content input. |
| AssetService:CreateDecalAsync | Decal | Creates a new Decal object using the provided EditableImage content maps. |
| AssetService:CreateEditableImage | EditableImage | Creates a new EditableImage. |
| AssetService:CreateEditableImageAsync | EditableImage | Creates a new EditableImage object populated with the given image. |
| AssetService:CreateEditableMesh | EditableMesh | Creates a new, empty EditableMesh. |
| AssetService:CreateEditableMeshAsync | EditableMesh | Returns a new EditableMesh object created from an existing mesh content ID. |
| AssetService:CreateMeshPartAsync | MeshPart | Creates a new MeshPart with a specified mesh ID and an optional table of fidelity values. |
| AssetService:CreatePlaceAsync | int64 | Clones a place through the given templatePlaceID. |
| AssetService:CreatePlaceInPlayerInventoryAsync | int64 | Clones a place through the given templatePlaceID and puts it into the inventory of the given player. |
| AssetService:CreateSurfaceAppearanceAsync | SurfaceAppearance | Creates a new SurfaceAppearance object using the provided content maps. |
| AssetService:GetAssetIdsForPackage | Array | Returns an array of asset IDs that are contained in a specified package. |
| AssetService:GetAssetIdsForPackageAsync | Array | Returns an array of asset IDs that are contained in a specified package. |
| AssetService:GetAudioMetadataAsync | Array | Provides relevant metadata about a specific audio source. |
| AssetService:GetBundleDetailsAsync | Dictionary | Returns details of the contents of specified bundle. |
| AssetService:GetCreatorAssetID | int64 | Returns the UserId of the account who created the creationID asset. |
| AssetService:GetGamePlacesAsync | Instance | Returns a StandardPages object which contains the name and PlaceId of places within the current experience. |
| AssetService:LoadAssetAsync | Instance | Loads a Model instance given its asset ID. This is the modern replacement for InsertService:LoadAsset() and supports loading third-party assets. |
| AssetService:PromptCreatePlatformContentAsync | Tuple | Allows in-experience asset creation for users by prompting a publish dialog. |
| AssetService:PromptImportAnimationClipFromVideoAsync | Tuple | Prompts the specified player to select and upload a video, which is then converted into an AnimationClip. |
| AssetService:SavePlaceAsync | () | Saves the state of the current place. |
| AssetService:SearchAudio | AudioPages | Finds audio assets matching a variety of search criteria. |
| AssetService:SearchAudioAsync | AudioPages | Finds audio assets matching a variety of search criteria. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
AssetService:ComposeDecalAsync
Modifies an existing Decal to contain a composed texture derived from one or more layered texture sets. Each set can include color, roughness, metalness, and normal maps. Each layer in layers is composited in the order they are provided, with the color map alpha channel used to determine blending.
- There is a limit of 8 layers.
- Layering order is bottom-to-top: the first layer in the list provides the bottom-most textures.
- Each dictionary table should contain the following key-value pairs:
ColorMapis mandatory in every layer. The ColorMap's alpha channel is used to control blending of the entire layer.NormalMap,MetalnessMap,RoughnessMapare optional. If omitted, this layer doesn't perform any blending for those maps.
Calling this method on a Decal that already has a pending ComposeDecalAsync call in progress raises an error; wait for the first call to resolve before issuing another on the same instance.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| decal | Decal | A Decal instance that will be modified to contain a representation of the layers. Any existing maps on this instance will be cleared. | |
| layers | Array | An array of dictionary tables that maps PBR names to Content IDs. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
Code samples: View on Creator Hub (AssetService-ComposeDecalAsync).
AssetService:CreateAssetAsync
Uploads a new asset to Roblox from the given object.
Currently, this method can only be used in locally loaded plugins and uploads assets without prompting first.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| object | Object | The object to be created as an asset. | |
| assetType | AssetType | Currently supported types are: - AssetType.Model – with object as any valid Instance root. - AssetType.Plugin – with object as any valid Instance root. - AssetType.Mesh – with object as any valid EditableMesh root. - AssetType.Image – with object as any valid EditableImage root. | |
| requestParameters | Dictionary | nil | Options table containing asset metadata: - Name – Name of the asset as a string. Defaults to [object.Name]. - Description – Description of the asset as a string. Defaults to "Created with AssetService:CreateAssetAsync". - CreatorId – ID of the asset creator as a number. Defaults to the logged in Roblox Studio user for Plugin context. Required for Open Cloud Luau Execution context. - CreatorType – AssetCreatorType indicating the type of asset creator. Defaults to AssetCreatorType.User in Plugin context. Required for Open Cloud Luau Execution context. - IsPackage – Boolean value, only applicable to the AssetType.Model type. Defaults to true. |
Returns
| Type | Description |
|---|---|
| Tuple | The CreateAssetResult and asset ID pair if successful. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
Code samples: View on Creator Hub (AssetService-CreateAssetAsync).
AssetService:CreateAssetVersionAsync
Uploads a new version for an existing asset from the given object.
Currently, this method can only be used in locally loaded plugins and uploads assets without prompting first.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| object | Object | The object to be created as an asset. | |
| assetType | AssetType | Currently supported types are: - AssetType.Model – with object as any valid Instance root. - AssetType.Plugin – with object as any valid Instance root. - AssetType.Mesh – with object as any valid EditableMesh root. - AssetType.Image – with object as any valid EditableImage root. | |
| assetId | int64 | The ID of the asset for the new version. | |
| requestParameters | Dictionary | nil | Options table containing asset metadata: - Name – A string. Name of the asset. Default: object.Name. - Description – A string. Description of the asset. Default: "Created with AssetService:CreateAssetAsync". - CreatorId – A number. ID of the asset creator. Default: The logged in Roblox Studio user for Plugin context. Required for Open Cloud Luau Execution context. - CreatorType – A AssetCreatorType. Type of asset creator. Default: AssetCreatorType.User in Plugin context. Required for Open Cloud Luau Execution context. - IsPackage – A bool. Only applicable to the AssetType.Model type. Default: true. |
Returns
| Type | Description |
|---|---|
| Tuple | The CreateAssetResult and asset version number pair if successful. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
Code samples: View on Creator Hub (AssetService-CreateAssetVersionAsync).
AssetService:CreateDataModelContentAsync
Creates ephemeral, DataModel-scoped content from the provided content input.
If the server storage budget is exhausted during this call, the creation will fail and the method will return CreateContentResult.StorageLimitExceeded alongside an empty Content object.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | Content | Reference to the input content. Currently, this only supports Content wrapping a EditableMesh or EditableImage. | |
| options | Dictionary? | Optional dictionary containing configuration controls for the created DataModel content. Currently no controls are surfaced and this parameter exists for future functionality. |
Returns
| Type | Description |
|---|---|
| Tuple | A tuple containing an CreateContentResult indicating the success or failure of the request, and the resulting DataModel-scoped Opaque Content. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["DynamicGeneration"] |
AssetService:CreateDecalAsync
Creates a new Decal object using the provided color and physically based rendering (PBR) content maps. Each supported key sets the corresponding Decal content property. All maps are optional individually, but at least one must be provided; a color texture is not required.
Use Content.fromObject() to wrap a EditableImage for each map. Asset IDs, URI-based content, and Content.none are not accepted. To use an image asset, first load it with AssetService:CreateEditableImageAsync(), then wrap the returned EditableImage with Content.fromObject().
Omitted maps remain unset. All other Decal properties retain their default values, and the returned decal has no parent. Set its Face and parent it to a BasePart to display it on the desired face.
Unrecognized keys are ignored with a warning. The method raises an error if no supported maps are provided, or if any supported key has a value that is not Content containing a EditableImage.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | Dictionary | Dictionary containing one or more of the following key-value pairs. Each value must be a Content object containing a EditableImage: - TextureContent — The decal's color texture. - NormalMapContent — The decal's normal map. - MetalnessMapContent — The decal's metalness map. - RoughnessMapContent — The decal's roughness map. |
Returns
| Type | Description |
|---|---|
| Decal | A new Decal instance with the given maps from the content parameter. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Basic"] |
AssetService:CreateEditableImage
Creates a new EditableImage. By default, the resolution is set at 512×512, but you can specify a different size using the method's option table.
If the device‑specific editable memory budget is exhausted, creation fails and this method returns nil.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| editableImageOptions | Dictionary? | Options table containing controls for the method: - Size – A Vector2 that specifies the image's desired width and height. |
Returns
| Type | Description |
|---|---|
| EditableImage | The new EditableImage, or nil if the device-specific editable memory budget is exhausted. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["DynamicGeneration"] |
AssetService:CreateEditableImageAsync
Creates a new EditableImage object populated with the given texture. Non-asset texture IDs such as rbxthumb:// are supported. If using an image asset, it must be associated with and/or owned by a creator of the experience, or it must have been created inside the experience. If the device-specific editable memory budget is exhausted, creation will fail and this method will return nil.
See the EditableImage documentation for special considerations when using this API.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | Content | Reference to asset content stored externally or as an object within the place, wrapping a single value of one of the supported ContentSourceType values. | |
| editableImageOptions | Dictionary? | Table containing options for the created EditableImage. Currently no options are available since resizing via Size is not supported. |
Returns
| Type | Description |
|---|---|
| EditableImage | A new EditableImage containing the provided image. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
AssetService:CreateEditableMesh
Creates a new, empty EditableMesh. Vertices, triangles, and their attributes can be added dynamically to it. If the device‑specific editable memory budget is exhausted, creation will fail and this method will return nil.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| editableMeshOptions | Dictionary? | Table containing options for the created EditableMesh. Currently no options are available since FixedSize will always be false for empty editable meshes. |
Returns
| Type | Description |
|---|---|
| EditableMesh | The new EditableMesh, or nil if the device-specific editable memory budget is exhausted. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["DynamicGeneration"] |
AssetService:CreateEditableMeshAsync
Returns a new EditableMesh object created from an existing EditableMesh or mesh Content ID. By default, an EditableMesh created from this method will be fixed size such that mesh data can only be modified, not added nor removed. A fixed size EditableMesh consumes less memory and should be preferred when possible.
If the device-specific editable memory budget is exhausted, creation will fail and this method will return nil.
See the Enabling for Published Experiences and Permissions sections of EditableMesh for special considerations when using this API.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | Content | Reference to asset content stored externally or as an object within the place, wrapping a single value of one of the supported ContentSourceType values. | |
| editableMeshOptions | Dictionary? | Options table containing controls for the method: - FixedSize – A bool. Default value is true, and the returned EditableMesh will not allow you to add or remove vertices, only modify their values. Set to false if the ability to change the mesh topology is required, at the expense of using more memory. |
Returns
| Type | Description |
|---|---|
| EditableMesh | The new EditableMesh object. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
AssetService:CreateMeshPartAsync
This method creates a MeshPart with a specified CollisionFidelity, RenderFidelity, and FluidFidelity. Because MeshPart.MeshId is read only, this method is for creating a mesh with any mesh ID through scripts, without having to clone an existing MeshPart. It throws errors if creation fails.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| meshContent | Content | Reference to asset content stored externally or as an object within the place, wrapping a single value of one of the supported ContentSourceType values. | |
| options | Dictionary | nil | Options table containing one or more controls for the method: - CollisionFidelity – The value of CollisionFidelity in the resulting part. Defaults to CollisionFidelity.Default if the option is absent or the options table is nil. - RenderFidelity – The value of RenderFidelity in the resulting part. Defaults to RenderFidelity.Automatic if the option is absent or the options table is nil. - FluidFidelity – The value of FluidFidelity in the resulting part. Defaults to FluidFidelity.Automatic if the option is absent or the options table is nil. |
Returns
| Type | Description |
|---|---|
| MeshPart | The new MeshPart with the specified mesh and fidelity settings applied. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Basic"] |
AssetService:CreatePlaceAsync
Clones a place through the given templatePlaceID and returns the PlaceId of the new place, which you can use with TeleportService. The clone place displays within the inventory of the place's creator with the given name and description.
Note that the template place must have template copying enabled through place settings. You cannot use this method to clone places that you don't own.
Frequent use of this API is not recommended, particularly if the created places contain scripts, as updating the code in a large volume of places quickly becomes infeasible. For user-generated worlds, consider serializing user creations and saving them in DataStores instead.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| placeName | string | Name of the new place. | |
| templatePlaceID | int64 | PlaceId of the place to clone. | |
| description | string | Description of the new place. |
Returns
| Type | Description |
|---|---|
| int64 | PlaceId of the new place. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
AssetService:CreatePlaceInPlayerInventoryAsync
Deprecated. This method has been removed and is no longer functional.
This method was removed in release 471 and no longer functions; calling it raises an error. It previously cloned the place identified by templatePlaceID and placed the copy into the given player's inventory. There is no direct replacement.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player | Instance | The Player whose inventory receives the cloned place. | |
| placeName | string | Name for the new place. | |
| templatePlaceID | int64 | PlaceId of the place to clone. | |
| description | string | Description for the new place. |
Returns
| Type | Description |
|---|---|
| int64 | PlaceId of the new place. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
AssetService:CreateSurfaceAppearanceAsync
Creates a new SurfaceAppearance object using the provided content maps.
Currently, content only supports EditableImage and only content maps can be specified, but functionality will expand to include asset IDs as input. If you need to achieve this today, you can create an EditableImage from an asset ID using the following:
AssetService:CreateEditableImageAsync(Content.fromUri(uri))
Default values will be used for all other SurfaceAppearance properties. Note that the EditableImage assigned to each map cannot be reassigned or swapped after the SurfaceAppearance is created.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| content | Dictionary | Dictionary containing the following key-value pairs: - ColorMap — A Content object that contains the color map. Default is nil. - MetalnessMap — A Content object that contains the metalness map. If more than one channel is present, only the red channel is used. Default is nil. - NormalMap — A Content object that contains the normal map. Default is nil. - RoughnessMap — A Content object that contains the roughness map. If more than one channel is present, only the red channel is used. Default is nil. - EmissiveMask — A Content object that contains the emissive mask. If more than one channel is present, only the red channel is used. Default is nil. |
Returns
| Type | Description |
|---|---|
| SurfaceAppearance | A new SurfaceAppearance instance with the given maps from the content parameter. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Basic"] |
Code samples: View on Creator Hub (AssetService-CreateSurfaceAppearanceAsync).
AssetService:GetAssetIdsForPackage
Deprecated. Use GetAssetIdsForPackageAsync() instead.
This deprecated method returns an array of asset IDs contained in the specified package. Use GetAssetIdsForPackageAsync() instead.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| packageAssetId | int64 | The asset ID of the package to query. |
Returns
| Type | Description |
|---|---|
| Array | Asset IDs that are contained in a specified package. |
| Field | Value |
|---|---|
| tags | ["Yields","Deprecated"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
AssetService:GetAssetIdsForPackageAsync
Returns an array of asset IDs that are contained in a specified package.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| packageAssetId | int64 | The asset ID of the package to query. |
Returns
| Type | Description |
|---|---|
| Array | Asset IDs that are contained in a specified package. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
AssetService:GetAudioMetadataAsync
Provides relevant metadata about a specific audio source (artist, title, duration, type, etc.).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| idList | Array | Array of asset or content IDs for which to retrieve metadata. Max batch size is 30. |
Returns
| Type | Description |
|---|---|
| Array | Array of dictionary tables in the same order as the request, where each dictionary contains the following metadata for its asset/content: - AssetId (string) - Title (string) - Artist (string) - Duration (number) in seconds - AudioType (AudioSubType) Note that if an error occurs on fetching metadata for any of the requested assets, for example the asset ID doesn't exist, its dictionary table is still included in the returned array but it only contains the AssetId field for reference purposes. Additionally, if the AudioType cannot be determined for a given asset (perhaps because it's private audio), the resulting dictionary will not contain an AudioType entry. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
Code samples: View on Creator Hub (AssetService-GetAudioMetadataAsync).
AssetService:GetBundleDetailsAsync
This function returns details of the contents of the specified bundle.
If the bundle ID does not exist, it throws HTTP 400 (Bad Request). If bundleId is not convertible to an integer, it throws Unable to cast string to int64.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| bundleId | int64 | The ID of the specified bundle. |
Returns
| Type | Description |
|---|---|
| Dictionary | Dictionary with the following key-value pairs containing details about the specified bundle: - Id — Bundle ID (same as passed bundleId argument) - Name — Bundle name - Description — Bundle description - BundleType — String representing the BundleType, for example "BodyParts" or "DynamicHead" - Items — Array of items in the bundle, each with details represented through the following keys: - Id — Item ID - Name — Item name - Type — Item type such as "Asset" - AssetType — String representing the AvatarAssetType - SupportsHeadShapes — Whether the asset supports head shape swapping. Only present if AssetType is "DynamicHead". |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
Code samples: View on Creator Hub (getting-bundle-details).
AssetService:GetCreatorAssetID
Deprecated. This item is deprecated and no longer functions correctly. Do not use it for new work.
The GetCreatorAssetID function returns the Player.UserId of the account who created the creationID asset.
This member is broken and doesn't function correctly. Avoid using it.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| creationID | int64 | The asset ID to look up for creator information. |
Returns
| Type | Description |
|---|---|
| int64 | The Player.UserId of the account that created the asset. |
| Field | Value |
|---|---|
| tags | ["Yields","Deprecated"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
AssetService:GetGamePlacesAsync
Returns a StandardPages object which contains the name and PlaceId of places within the current experience.
Returns
| Type | Description |
|---|---|
| Instance | A StandardPages object whose pages contain the name and PlaceId of each place in the current experience. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
Code samples: View on Creator Hub (AssetService-GetGamePlacesAsync1).
AssetService:LoadAssetAsync
Loads the latest version of an asset from the given assetId and returns it wrapped in a Model. This method is the modern replacement for InsertService:LoadAsset() and InsertService:LoadAssetVersion() methods.
Calls to this function may fail if the asset does not exist, or if the server providing the model is having problems. It is recommended to wrap calls to this function in pcall() to handle potential errors.
local AssetService = game:GetService("AssetService")
local assetId = 257489726
local success, model = pcall(AssetService.LoadAssetAsync, AssetService, assetId)
if success and model then
print("Model loaded successfully")
model.Parent = workspace
else
warn("Model failed to load:", model) -- 'model' will contain the error message
end Script Sandbox Security
For enhanced security, the returned Model is sandboxed by default (Sandboxed is true) and has no script Capabilities. This prevents untrusted scripts descending from the returned Model from running. To enable scripts in a model you trust, you can manually grant a safe set of Capabilities on the Model after loading.
Third-Party Asset Loading
Unlike InsertService:LoadAsset(), this method can load public assets created by third parties (assets not owned by the experience creator). To enable this functionality, toggle on Allow Loading Third Party Assets in Studio's Experience Settings.
If this setting is disabled (which it is by default), LoadAssetAsync will only load assets that are owned by the experience creator, behaving identically to the old InsertService:LoadAsset() security check.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| assetId | int64 | The asset ID number of the asset being loaded. |
Returns
| Type | Description |
|---|---|
| Instance | A Model instance containing the loaded asset. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["LoadUnownedAsset"] |
AssetService:PromptCreatePlatformContentAsync
Allows in-experience asset creation for users by prompting a publish dialog. When called, it presents a dialog to the user, allowing them to enter a name, description, and preview the asset. Upon submitting, it saves the asset to the user's inventory. Can only be invoked on the server side.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player | Player | The user who submits an asset creation. | |
| object | Object | The asset to be created. Currently can't contain scripts or nest non-public assets. | |
| assetType | AssetType | The asset type. Currently can only be AssetType.Model. |
Returns
| Type | Description |
|---|---|
| Tuple | The Enum.PromptCreatePlatformContentResult and asset ID pair if successful. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
AssetService:PromptImportAnimationClipFromVideoAsync
Prompts the given player to select and upload a video on their own client, then converts the uploaded video into an AnimationClip and returns it. The player must grant consent through the prompt before the upload proceeds; if they decline or provide no input, the method resolves with AnimationClipFromVideoStatus.Cancelled and no clip.
This method can only be called from the server. The returned AnimationClipFromVideoStatus reports success or the reason processing failed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player | Player | The player who is prompted, on their own client, to select and upload a video. The player's consent is required before the video is uploaded. | |
| progressCallback | Function | A function that receives status updates (an AnimationClipFromVideoStatus value) while the video is uploaded and processed. |
Returns
| Type | Description |
|---|---|
| Tuple | A tuple containing an AnimationClipFromVideoStatus describing the outcome and, on success, the resulting AnimationClip (nil otherwise). |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetManagement"] |
AssetService:SavePlaceAsync
Saves the current state of the place. Keep in mind the following guidelines and restrictions:
- This method only works for places that are created with
AssetService:CreatePlaceAsync()or that have the API enabled through the place's settings. - This method overwrites the previous state of the place. To revert a save, publish an older version of the place.
- There are cases when saves can occur simultaneously in Studio and in multiple experience servers. The order of the saves happen in the order they are called.
- An active Team Create session in Studio blocks all saves from occurring.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| requestParameters | Dictionary? | Optional dictionary that includes SaveWithoutPublish, a boolean indicating whether to save with publish or without publish, and PlaceId, the destination place ID to save over. An example usage would be: AssetService:SavePlaceAsync({PlaceId = 1, SaveWithoutPublish = true}). If PlaceId is not provided, the default behavior will save over the current original place which is calling SavePlaceAsync. If SaveWithoutPublish is not provided, the default behavior is SaveWithoutPublish=false. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetCreateUpdate"] |
AssetService:SearchAudio
Deprecated. Use SearchAudioAsync() instead.
This deprecated method finds audio assets matching a variety of search criteria. Use SearchAudioAsync() instead.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| searchParameters | AudioSearchParams | A AudioSearchParams object defining the search criteria such as keyword, title, artist, audio type, and duration range. |
Returns
| Type | Description |
|---|---|
| AudioPages | An AudioPages object containing the paginated results of the audio search. |
| Field | Value |
|---|---|
| tags | ["Yields","Deprecated"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
Code samples: View on Creator Hub (printing-search-audio-result-titles).
AssetService:SearchAudioAsync
Returns a AudioPages object containing the result of the given search. Will not return fields with empty values.
Note that this method has a low HTTP request limit and can throw an error, so it should always be wrapped in pcall() for error handling. Possible error messages include:
| Error Message | Reason |
|---|---|
| HTTP 429 (Too Many Requests) | Class.AssetService:SearchAudio() has been called too many times. |
| Unexpected type for data, expected array got null | The keyword argument was filtered. |
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| searchParameters | AudioSearchParams | A AudioSearchParams object defining the search criteria such as keyword, title, artist, audio type, and duration range. |
Returns
| Type | Description |
|---|---|
| AudioPages | An AudioPages object containing the paginated results of the audio search. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["AssetRead"] |
Code samples: View on Creator Hub (printing-search-audio-result-titles).
Events
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |