InsertService

Show Deprecated
Not Creatable
Service

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

Summary

Methods

Properties

AllowClientInsertModels

Not Scriptable
Read Parallel

Methods

CreateMeshPartAsync

Yields

Parameters

meshId: ContentId
collisionFidelity: Enum.CollisionFidelity
renderFidelity: Enum.RenderFidelity

Returns

GetFreeDecals

Yields

Parameters

searchText: string
pageNum: number

Returns

Code Samples

InsertService:GetFreeDecals

local InsertService = game:GetService("InsertService")
local page = unpack(InsertService:GetFreeDecals("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

GetFreeModels

Yields

Parameters

searchText: string
pageNum: number

Returns

Code Samples

InsertService:GetFreeModels

local InsertService = game:GetService("InsertService")
local page = unpack(InsertService:GetFreeModels("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

GetLatestAssetVersionAsync

Yields

Parameters

assetId: number

Returns

LoadAsset

Yields

Parameters

assetId: number

Returns

Code Samples

InsertService:LoadAsset

local InsertService = game:GetService("InsertService")
local ASSET_ID = 82353
local asset = InsertService:LoadAsset(ASSET_ID)
asset.Parent = workspace

LoadAssetVersion

Yields

Parameters

assetVersionId: number

Returns

Code Samples

InsertService:LoadAssetVersion

local InsertService = game:GetService("InsertService")
local ASSET_VERSION_ID = 296050499
local asset = InsertService:LoadAssetVersion(ASSET_VERSION_ID)
asset.Parent = game.Workspace

Events