InsertService
Used to insert assets from the Roblox website.
Memory category | Instances |
---|
Member index 23
Removed member index 11
History | Member | |
---|---|---|
311 | SetAdvancedResults(enable: bool, user: bool = false): void | |
311 | SetAssetUrl(assetUrl: string): void | |
311 | SetAssetVersionUrl(assetVersionUrl: string): void | |
311 | SetBaseCategoryUrl(baseSetsUrl: string): void | |
311 | SetBaseSetsUrl(baseSetsUrl: string): void | |
311 | SetCollectionUrl(collectionUrl: string): void | |
311 | SetFreeDecalUrl(freeDecalUrl: string): void | |
311 | SetFreeModelUrl(freeModelUrl: string): void | |
311 | SetTrustLevel(trustLevel: float): void | |
311 | SetUserCategoryUrl(userSetsUrl: string): void | |
311 | SetUserSetsUrl(userSetsUrl: string): void |
Description
InsertService is used to insert assets from the Roblox website, typically the LoadAsset function.
To load an asset, it must be accessible by the creator of the experience loading it, which can be either a user or group. Should an experience be uploaded by a different creator, the asset data would not be accessible. See the LoadAsset() method for more details on this security check. Note that you should not use this service for loading API keys or other secrets. Use HttpService:GetSecret() instead.
See Also
- AssetService, which can provide information about assets you might want to load using InsertService
History 108
- 648 Change ReturnType of LoadPackageAssetAsync from Objects to Instances
- 648 Change ReturnType of LoadPackageAsset from Objects to Instances
- 648 Change ReturnType of LoadAssetWithFormat from Objects to Instances
- 645 Change Parameters of LoadPackageAssetAsync from (url: Content) to (url: ContentId)
- 645 Change Parameters of LoadPackageAsset from (url: Content) to (url: ContentId)
- 645 Change Parameters of CreateMeshPartAsync from (meshId: Content, collisionFidelity: CollisionFidelity, renderFidelity: RenderFidelity) to (meshId: ContentId, collisionFidelity: CollisionFidelity, renderFidelity: RenderFidelity)
- 641 Change Tags of GetUserSets from [Yields] to [Yields, Deprecated]
- 641 Change Tags of GetCollection from [Yields] to [Yields, Deprecated]
- 626 Change Security of CreateMeshPartAsync from PluginSecurity to None
- 603 Change Tags of GetBaseSets from [Yields] to [Yields, Deprecated]
- 576 Add LoadAssetWithFormat
- 573 Change ReturnType of Insert from void to null
- 573 Change ReturnType of ApproveAssetVersionId from void to null
- 573 Change ReturnType of ApproveAssetId from void to null
- 567 Add GetLocalFileContents
- 553 Add
- 553 Change PreferredDescriptor of loadAsset from to LoadAsset
- 553 Change PreferredDescriptor of GetUserCategories from to GetUserSets
- 553 Change PreferredDescriptor of GetBaseCategories from to GetBaseSets
- 553 Change Default of AllowInsertFreeModels from to false
- 553 Change Default of AllowClientInsertModels from to false
- 486 Change ThreadSafety of AllowInsertFreeModels from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AllowClientInsertModels from ReadOnly to ReadSafe
- 484 Change ReturnType of CreateMeshPartAsync from Instance to MeshPart
- 462 Change ThreadSafety of loadAsset from to Unsafe
- 462 Change ThreadSafety of LoadPackageAssetAsync from to Unsafe
- 462 Change ThreadSafety of LoadPackageAsset from to Unsafe
- 462 Change ThreadSafety of LoadLocalAsset from to Unsafe
- 462 Change ThreadSafety of LoadAssetVersion from to Unsafe
- 462 Change ThreadSafety of LoadAsset from to Unsafe
- 462 Change ThreadSafety of Insert from to Unsafe
- 462 Change ThreadSafety of GetUserSets from to Unsafe
- 462 Change ThreadSafety of GetUserCategories from to Unsafe
- 462 Change ThreadSafety of GetLatestAssetVersionAsync from to Unsafe
- 462 Change ThreadSafety of GetFreeModels from to Unsafe
- 462 Change ThreadSafety of GetFreeDecals from to Unsafe
- 462 Change ThreadSafety of GetCollection from to Unsafe
- 462 Change ThreadSafety of GetBaseSets from to Unsafe
- 462 Change ThreadSafety of GetBaseCategories from to Unsafe
- 462 Change ThreadSafety of CreateMeshPartAsync from to Unsafe
- 462 Change ThreadSafety of ApproveAssetVersionId from to Unsafe
- 462 Change ThreadSafety of ApproveAssetId from to Unsafe
- 462 Change ThreadSafety of AllowInsertFreeModels from to ReadOnly
- 462 Change ThreadSafety of AllowClientInsertModels from to ReadOnly
- 459 Add LoadPackageAssetAsync
- 458 Remove LoadPackageAssetAsync
- 459 Add LoadPackageAssetAsync
- 454 Add CreateMeshPartAsync
- 452 Remove CreateMeshPartAsync
- 453 Add CreateMeshPartAsync
- 353 Add LoadPackageAsset
- 349 Add AllowClientInsertModels
- 319 Change Parameters of loadAsset from (assetId: int) to (assetId: int64)
- 319 Add LoadLocalAsset
- 319 Change Parameters of LoadAssetVersion from (assetVersionId: int) to (assetVersionId: int64)
- 319 Change Parameters of LoadAsset from (assetId: int) to (assetId: int64)
- 319 Change Parameters of GetUserSets from (userId: int) to (userId: int64)
- 319 Change Parameters of GetUserCategories from (userId: int) to (userId: int64)
- 319 Change ReturnType of GetLatestAssetVersionAsync from int to int64
- 319 Change Parameters of GetLatestAssetVersionAsync from (assetId: int) to (assetId: int64)
- 319 Change Parameters of GetCollection from (categoryId: int) to (categoryId: int64)
- 319 Change Parameters of ApproveAssetVersionId from (assetVersionId: int) to (assetVersionId: int64)
- 319 Change Parameters of ApproveAssetId from (assetId: int) to (assetId: int64)
- 311 Remove SetUserSetsUrl
- 311 Remove SetUserCategoryUrl
- 311 Remove SetTrustLevel
- 311 Remove SetFreeModelUrl
- 311 Remove SetFreeDecalUrl
- 311 Remove SetCollectionUrl
- 311 Remove SetBaseSetsUrl
- 311 Remove SetBaseCategoryUrl
- 311 Remove SetAssetVersionUrl
- 311 Remove SetAssetUrl
- 311 Remove SetAdvancedResults
- 259 Change Tags of AllowInsertFreeModels from [NotReplicated] to [NotReplicated, NotBrowsable, Deprecated]
- 224 Add AllowInsertFreeModels
- 208 Change Tags of Insert from [] to [Deprecated]
- 207 Add GetLatestAssetVersionAsync
- 68 Add loadAsset
- 55 Change Tags of GetUserCategories from [Yields] to [Yields, Deprecated]
- 55 Change Tags of GetBaseCategories from [Yields] to [Yields, Deprecated]
- 55 Change Tags of InsertService from [preliminary, NotCreatable, Service] to [NotCreatable, Service]
- 49 Change Tags of ApproveAssetVersionId from [] to [Deprecated]
- 49 Change Tags of ApproveAssetId from [] to [Deprecated]
- 47 Add SetUserSetsUrl
- 47 Add SetUserCategoryUrl
- 47 Add SetTrustLevel
- 47 Add SetFreeModelUrl
- 47 Add SetFreeDecalUrl
- 47 Add SetCollectionUrl
- 47 Add SetBaseSetsUrl
- 47 Add SetBaseCategoryUrl
- 47 Add SetAssetVersionUrl
- 47 Add SetAssetUrl
- 47 Add SetAdvancedResults
- 47 Add LoadAssetVersion
- 47 Add LoadAsset
- 47 Add Insert
- 47 Add GetUserSets
- 47 Add GetUserCategories
- 47 Add GetFreeModels
- 47 Add GetFreeDecals
- 47 Add GetCollection
- 47 Add GetBaseSets
- 47 Add GetBaseCategories
- 47 Add ApproveAssetVersionId
- 47 Add ApproveAssetId
- 47 Add InsertService
Members 23
AllowClientInsertModels
Type | Default | |
---|---|---|
bool | false |
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 4
- 553 Change Default of AllowClientInsertModels from to false
- 486 Change ThreadSafety of AllowClientInsertModels from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AllowClientInsertModels from to ReadOnly
- 349 Add AllowClientInsertModels
AllowInsertFreeModels
Type | Default | |
---|---|---|
bool | false |
The AllowInsertFreeModels property toggles whether ''Free Models'' can be inserted into the game, regardless of whether the place owner owns the asset.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 5
- 553 Change Default of AllowInsertFreeModels from to false
- 486 Change ThreadSafety of AllowInsertFreeModels from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AllowInsertFreeModels from to ReadOnly
- 259 Change Tags of AllowInsertFreeModels from [NotReplicated] to [NotReplicated, NotBrowsable, Deprecated]
- 224 Add AllowInsertFreeModels
ApproveAssetId
Parameters (1) | ||
---|---|---|
assetId | int64 | |
Returns (1) | ||
null |
Thread safety | Unsafe |
---|
History 5
- 573 Change ReturnType of ApproveAssetId from void to null
- 462 Change ThreadSafety of ApproveAssetId from to Unsafe
- 319 Change Parameters of ApproveAssetId from (assetId: int) to (assetId: int64)
- 49 Change Tags of ApproveAssetId from [] to [Deprecated]
- 47 Add ApproveAssetId
ApproveAssetVersionId
Parameters (1) | ||
---|---|---|
assetVersionId | int64 | |
Returns (1) | ||
null |
Thread safety | Unsafe |
---|
History 5
- 573 Change ReturnType of ApproveAssetVersionId from void to null
- 462 Change ThreadSafety of ApproveAssetVersionId from to Unsafe
- 319 Change Parameters of ApproveAssetVersionId from (assetVersionId: int) to (assetVersionId: int64)
- 49 Change Tags of ApproveAssetVersionId from [] to [Deprecated]
- 47 Add ApproveAssetVersionId
CreateMeshPartAsync
Parameters (3) | ||
---|---|---|
meshId | ContentId | |
collisionFidelity | CollisionFidelity | |
renderFidelity | RenderFidelity | |
Returns (1) | ||
MeshPart |
Creates a new MeshPart with specified CollisionFidelity and RenderFidelity. Because MeshPart.MeshId is read only, this is the way to create a MeshPart through scripts without having to clone an existing one. It throws errors if creation fails.
Thread safety | Unsafe |
---|
History 7
- 645 Change Parameters of CreateMeshPartAsync from (meshId: Content, collisionFidelity: CollisionFidelity, renderFidelity: RenderFidelity) to (meshId: ContentId, collisionFidelity: CollisionFidelity, renderFidelity: RenderFidelity)
- 626 Change Security of CreateMeshPartAsync from PluginSecurity to None
- 484 Change ReturnType of CreateMeshPartAsync from Instance to MeshPart
- 462 Change ThreadSafety of CreateMeshPartAsync from to Unsafe
- 454 Add CreateMeshPartAsync
- 452 Remove CreateMeshPartAsync
- 453 Add CreateMeshPartAsync
GetBaseCategories
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Thread safety | Unsafe |
---|
History 4
- 553 Change PreferredDescriptor of GetBaseCategories from to GetBaseSets
- 462 Change ThreadSafety of GetBaseCategories from to Unsafe
- 55 Change Tags of GetBaseCategories from [Yields] to [Yields, Deprecated]
- 47 Add GetBaseCategories
GetBaseSets
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Returns an array of dictionaries, containing information about various Roblox approved sets.
Thread safety | Unsafe |
---|
History 3
- 603 Change Tags of GetBaseSets from [Yields] to [Yields, Deprecated]
- 462 Change ThreadSafety of GetBaseSets from to Unsafe
- 47 Add GetBaseSets
GetCollection
Parameters (1) | ||
---|---|---|
categoryId | int64 | |
Returns (1) | ||
Array |
Returns the most recently uploaded models in the specified category.
Thread safety | Unsafe |
---|
History 4
- 641 Change Tags of GetCollection from [Yields] to [Yields, Deprecated]
- 462 Change ThreadSafety of GetCollection from to Unsafe
- 319 Change Parameters of GetCollection from (categoryId: int) to (categoryId: int64)
- 47 Add GetCollection
GetFreeDecals
Parameters (2) | ||
---|---|---|
searchText | string | |
pageNum | int | |
Returns (1) | ||
Array |
The GetFreeDecals function retrieves a list of free Decals from the Catalog. The return type for this method is very odd, as it returns a single table wrapped in a table.
The best way to explain it is to show a visual of the array returned:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
An example for iterating over this list has been provided at the bottom of this page.
Additionally, if you want to insert Models instead, you can use the InsertService:GetFreeModels() function.
Note: The page argument starts at 0. So Page 1 = 0, Page 2 = 1, etc.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetFreeDecals from to Unsafe
- 47 Add GetFreeDecals
GetFreeModels
Parameters (2) | ||
---|---|---|
searchText | string | |
pageNum | int | |
Returns (1) | ||
Array |
The GetFreeModels function retrieves a list of Free Models from the Catalog. The return type for this method is very odd, as it returns a single table wrapped in a table.
The best way to explain it is to show a visual of the array returned:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
An example for iterating over this list has been provided at the bottom of this page.
Additionally, if you would like to insert free Decals, you can use the InsertService:GetFreeDecals() function.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetFreeModels from to Unsafe
- 47 Add GetFreeModels
GetLatestAssetVersionAsync
Parameters (1) | ||
---|---|---|
assetId | int64 | |
Returns (1) | ||
int64 |
Returns the latest AssetVersionId of an asset for assets created by the place creator. Can be used in combination with InsertService:LoadAssetVersion() to load the latest version of a model, even if it gets updated while the game is running.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of GetLatestAssetVersionAsync from to Unsafe
- 319 Change ReturnType of GetLatestAssetVersionAsync from int to int64
- 319 Change Parameters of GetLatestAssetVersionAsync from (assetId: int) to (assetId: int64)
- 207 Add GetLatestAssetVersionAsync
GetLocalFileContents
Parameters (1) | ||
---|---|---|
contentId | string | |
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
GetUserCategories
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Array |
Thread safety | Unsafe |
---|
History 5
- 553 Change PreferredDescriptor of GetUserCategories from to GetUserSets
- 462 Change ThreadSafety of GetUserCategories from to Unsafe
- 319 Change Parameters of GetUserCategories from (userId: int) to (userId: int64)
- 55 Change Tags of GetUserCategories from [Yields] to [Yields, Deprecated]
- 47 Add GetUserCategories
GetUserSets
Parameters (1) | ||
---|---|---|
userId | int64 | |
Returns (1) | ||
Array |
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. |
Thread safety | Unsafe |
---|
History 4
- 641 Change Tags of GetUserSets from [Yields] to [Yields, Deprecated]
- 462 Change ThreadSafety of GetUserSets from to Unsafe
- 319 Change Parameters of GetUserSets from (userId: int) to (userId: int64)
- 47 Add GetUserSets
Insert
Parameters (1) | ||
---|---|---|
instance | Instance | |
Returns (1) | ||
null |
The Insert function is an ancient method used to insert an Instance into Workspace.
Thread safety | Unsafe |
---|
LoadAsset
Parameters (1) | ||
---|---|---|
assetId | int64 | |
Returns (1) | ||
Instance |
The LoadAsset function fetches an asset given its ID and returns a Model containing the asset. For example, to load this public Doge Model, which has the asset ID 257489726, you can use:
1 2 3 4 |
|
Calls to this function may fail if a server providing a model is having
problems. As such, it's generally a good idea to wrap calls to this
function in pcall
to catch these kinds of errors.
1 2 3 4 5 6 7 8 9 |
|
Security Check
An asset loaded by this function must be created or owned by either the game creator or Roblox. Additionally, benign asset types such as t-shirts, shirts, pants and avatar accessories are loadable from any game as they are public.
See also:
- AssetService:GetBundleDetailsAsync(), to find out which assets are associated with a bundle.
- For plugins, see DataModel:GetObjects()
Thread safety | Unsafe |
---|
LoadAssetVersion
Parameters (1) | ||
---|---|---|
assetVersionId | int64 | |
Returns (1) | ||
Instance |
Returns a model inserted into InsertService containing the asset with the given assetVersionId.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of LoadAssetVersion from to Unsafe
- 319 Change Parameters of LoadAssetVersion from (assetVersionId: int) to (assetVersionId: int64)
- 47 Add LoadAssetVersion
LoadAssetWithFormat
Parameters (2) | ||
---|---|---|
assetId | int64 | |
format | string | |
Returns (1) | ||
Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 648 Change ReturnType of LoadAssetWithFormat from Objects to Instances
- 576 Add LoadAssetWithFormat
LoadLocalAsset
Parameters (1) | ||
---|---|---|
assetPath | string | |
Returns (1) | ||
Instance |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of LoadLocalAsset from to Unsafe
- 319 Add LoadLocalAsset
LoadPackageAsset
Parameters (1) | ||
---|---|---|
url | ContentId | |
Returns (1) | ||
Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 648 Change ReturnType of LoadPackageAsset from Objects to Instances
- 645 Change Parameters of LoadPackageAsset from (url: Content) to (url: ContentId)
- 462 Change ThreadSafety of LoadPackageAsset from to Unsafe
- 353 Add LoadPackageAsset
LoadPackageAssetAsync
Parameters (1) | ||
---|---|---|
url | ContentId | |
Returns (1) | ||
Instances |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 6
- 648 Change ReturnType of LoadPackageAssetAsync from Objects to Instances
- 645 Change Parameters of LoadPackageAssetAsync from (url: Content) to (url: ContentId)
- 462 Change ThreadSafety of LoadPackageAssetAsync from to Unsafe
- 459 Add LoadPackageAssetAsync
- 458 Remove LoadPackageAssetAsync
- 459 Add LoadPackageAssetAsync
loadAsset
Parameters (1) | ||
---|---|---|
assetId | int64 | |
Returns (1) | ||
Instance |
Thread safety | Unsafe |
---|
Removed members 11
SetAdvancedResults
Parameters (2) | Default | |
---|---|---|
enable | bool | |
user | bool | false |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetAdvancedResults
- 47 Add SetAdvancedResults
SetAssetUrl
Parameters (1) | ||
---|---|---|
assetUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetAssetUrl
- 47 Add SetAssetUrl
SetAssetVersionUrl
Parameters (1) | ||
---|---|---|
assetVersionUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetAssetVersionUrl
- 47 Add SetAssetVersionUrl
SetBaseCategoryUrl
Parameters (1) | ||
---|---|---|
baseSetsUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetBaseCategoryUrl
- 47 Add SetBaseCategoryUrl
SetBaseSetsUrl
Parameters (1) | ||
---|---|---|
baseSetsUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetBaseSetsUrl
- 47 Add SetBaseSetsUrl
SetCollectionUrl
Parameters (1) | ||
---|---|---|
collectionUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetCollectionUrl
- 47 Add SetCollectionUrl
SetFreeDecalUrl
Parameters (1) | ||
---|---|---|
freeDecalUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetFreeDecalUrl
- 47 Add SetFreeDecalUrl
SetFreeModelUrl
Parameters (1) | ||
---|---|---|
freeModelUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetFreeModelUrl
- 47 Add SetFreeModelUrl
SetTrustLevel
Parameters (1) | ||
---|---|---|
trustLevel | float | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetTrustLevel
- 47 Add SetTrustLevel
SetUserCategoryUrl
Parameters (1) | ||
---|---|---|
userSetsUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetUserCategoryUrl
- 47 Add SetUserCategoryUrl
SetUserSetsUrl
Parameters (1) | ||
---|---|---|
userSetsUrl | string | |
Returns (1) | ||
void |
Security | LocalUserSecurity |
---|
History 2
- 311 Remove SetUserSetsUrl
- 47 Add SetUserSetsUrl