InsertService
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
Properties
Methods
- CreateMeshPartAsync(meshId : ContentId,collisionFidelity : Enum.CollisionFidelity,renderFidelity : Enum.RenderFidelity):MeshPart
Creates a new MeshPart with specified fidelity values.
Retrieves a list of free Decals from the Catalog.
Retrieves a list of Free Models from the Catalog.
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.
Returns a Model containing the asset.
Returns a model inserted into InsertService containing the asset with the given assetVersionId.
Properties
AllowClientInsertModels
Methods
CreateMeshPartAsync
Parameters
Returns
GetFreeDecals
Parameters
Returns
Code Samples
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
Parameters
Returns
Code Samples
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
LoadAsset
Parameters
Returns
Code Samples
local InsertService = game:GetService("InsertService")
local ASSET_ID = 82353
local asset = InsertService:LoadAsset(ASSET_ID)
asset.Parent = workspace