學習
引擎類別
AvatarEditorService
無法建立
服務

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
方法
GetBatchItemDetails(itemIds: {any},itemType: Enum.AvatarItemType):{any}
已棄用
GetFavorite(itemId: number,itemType: Enum.AvatarItemType):boolean
已棄用
GetInventory(assetTypes: {any}):InventoryPages
已棄用
GetOutfitDetails(outfitId: number):Dictionary
已棄用
GetOutfits(outfitSource: Enum.OutfitSource,outfitType: Enum.OutfitType):OutfitPages
已棄用
GetRecommendedAssets(assetType: Enum.AvatarAssetType,contextAssetId: number):{any}
已棄用
GetRecommendedBundles(bundleId: number):{any}
已棄用
PromptCreateOutfit(outfit: HumanoidDescription,rigType: Enum.HumanoidRigType,outfitOptions: Dictionary,outfitType: Variant):()
PromptSetFavorite(itemId: number,itemType: Enum.AvatarItemType,shouldFavorite: boolean):()
SearchCatalog(searchParameters: CatalogSearchParams):CatalogPages
已棄用
繼承成員

API 參考
方法
CheckApplyDefaultClothing
已棄用

CheckApplyDefaultClothingAsync
暫停
功能: AvatarAppearance
AvatarEditorService:CheckApplyDefaultClothingAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
參數
humanoidDescription:HumanoidDescription

ConformToAvatarRules
已棄用

ConformToAvatarRulesAsync
暫停
功能: AvatarAppearance
AvatarEditorService:ConformToAvatarRulesAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
參數
humanoidDescription:HumanoidDescription

GetAccessoryType
AvatarEditorService:GetAccessoryType(avatarAssetType:Enum.AvatarAssetType):Enum.AccessoryType
參數
avatarAssetType:Enum.AvatarAssetType

GetAvatarRules
已棄用

GetAvatarRulesAsync
暫停
AvatarEditorService:GetAvatarRulesAsync():Dictionary

GetBatchItemDetails
已棄用

GetBatchItemDetailsAsync
暫停
功能: AssetRead
AvatarEditorService:GetBatchItemDetailsAsync(
itemIds:{any}, itemType:Enum.AvatarItemType
參數
itemIds:{any}
返回

GetBundlesByAssetIdAsync
暫停
功能: AssetRead
AvatarEditorService:GetBundlesByAssetIdAsync(
assetId:number, limit:number
參數
assetId:number
limit:number
預設值:10

GetFavorite
已棄用

GetFavoriteAsync
暫停
功能: Players, AssetRead
AvatarEditorService:GetFavoriteAsync(
itemId:number, itemType:Enum.AvatarItemType
參數
itemId:number
返回

GetHeadShapesAsync
暫停
功能: Players, AssetRead
AvatarEditorService:GetHeadShapesAsync():{any}
返回
範例程式碼
獲取擁有的頭型
TEST
local AvatarEditorService = game:GetService("AvatarEditorService")
AvatarEditorService:PromptAllowInventoryReadAccess()
local result = AvatarEditorService.PromptAllowInventoryReadAccessCompleted:Wait()
if result == Enum.AvatarPromptResult.Success then
local shapes = AvatarEditorService:GetHeadShapesAsync()
for i, shape in ipairs(shapes) do
print(i, shape)
end
end

GetInventory
已棄用

GetInventoryAsync
暫停
功能: Players, AssetRead
AvatarEditorService:GetInventoryAsync(assetTypes:{any}):InventoryPages
參數
assetTypes:{any}
範例程式碼
尋找即將過期的物品
local AvatarEditorService = game:GetService("AvatarEditorService")
local pages = AvatarEditorService:GetInventoryAsync({ Enum.AvatarAssetType.Hat })
local currentPage = pages:GetCurrentPage()
for _, item in currentPage do
if item.ExpirationTime then
local secondsLeft = item.ExpirationTime.UnixTimestamp - DateTime.now().UnixTimestamp
local hoursLeft = math.floor(secondsLeft / 3600)
if hoursLeft < 24 then
warn(string.format("%s 在 %d 小時內過期", item.Name, hoursLeft))
end
end
end

GetItemDetails
已棄用

GetItemDetailsAsync
暫停
功能: AssetRead
AvatarEditorService:GetItemDetailsAsync(
itemId:number, itemType:Enum.AvatarItemType
參數
itemId:number
範例程式碼
檢查物品過期
local AvatarEditorService = game:GetService("AvatarEditorService")
local details = AvatarEditorService:GetItemDetailsAsync(105589844216517, Enum.AvatarItemType.Asset)
if details.ExpirationTime then
local secondsLeft = details.ExpirationTime.UnixTimestamp - DateTime.now().UnixTimestamp
local hoursLeft = math.floor(secondsLeft / 3600)
if hoursLeft < 24 then
warn(details.Name .. " 在24小時內過期!")
end
end

GetOutfitDetails
已棄用

GetOutfitDetailsAsync
暫停
功能: AssetRead
AvatarEditorService:GetOutfitDetailsAsync(outfitId:number):Dictionary
參數
outfitId:number

GetOutfits
已棄用

GetOutfitsAsync
暫停
功能: Players, AssetRead
AvatarEditorService:GetOutfitsAsync(
outfitSource:Enum.OutfitSource, outfitType:Enum.OutfitType
參數
outfitSource:Enum.OutfitSource
預設值:"All"
outfitType:Enum.OutfitType
預設值:"All"

GetRecommendedAssets
已棄用

GetRecommendedAssetsAsync
暫停
功能: AssetRead
AvatarEditorService:GetRecommendedAssetsAsync(
assetType:Enum.AvatarAssetType, contextAssetId:number
參數
contextAssetId:number
預設值:0
返回
範例程式碼
獲取帽子推薦
local AvatarEditorService = game:GetService("AvatarEditorService")
local assets = AvatarEditorService:GetRecommendedAssetsAsync(Enum.AvatarAssetType.Hat, 9255093)
for _, asset in ipairs(assets) do
print(asset.Item.Name)
end

GetRecommendedBundles
已棄用

GetRecommendedBundlesAsync
暫停
功能: AssetRead
AvatarEditorService:GetRecommendedBundlesAsync(bundleId:number):{any}
參數
bundleId:number
返回

PromptAllowInventoryReadAccess
功能: Players, AssetRead
AvatarEditorService:PromptAllowInventoryReadAccess():()
返回
()

PromptCreateOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptCreateOutfit(
outfit:HumanoidDescription, rigType:Enum.HumanoidRigType, outfitOptions:Dictionary, outfitType:Variant
):()
參數
outfitOptions:Dictionary
預設值:"nil"
outfitType:Variant
返回
()

PromptDeleteOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptDeleteOutfit(outfitId:number):()
參數
outfitId:number
返回
()

PromptRenameOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptRenameOutfit(outfitId:number):()
參數
outfitId:number
返回
()

PromptSaveAvatar
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptSaveAvatar(
humanoidDescription:HumanoidDescription, rigType:Enum.HumanoidRigType
):()
參數
humanoidDescription:HumanoidDescription
返回
()

PromptSetFavorite
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptSetFavorite(
itemId:number, itemType:Enum.AvatarItemType, shouldFavorite:boolean
):()
參數
itemId:number
shouldFavorite:boolean
返回
()

PromptUpdateOutfit
功能: Players, PlatformAvatarEditing
AvatarEditorService:PromptUpdateOutfit(
outfitId:number, updatedOutfit:HumanoidDescription, rigType:Enum.HumanoidRigType
):()
參數
outfitId:number
updatedOutfit:HumanoidDescription
返回
()

SearchCatalog
已棄用

SearchCatalogAsync
暫停
功能: AssetRead
AvatarEditorService:SearchCatalogAsync(searchParameters:CatalogSearchParams):CatalogPages
參數
searchParameters:CatalogSearchParams
範例程式碼
搜索具有時間選項的物品
local AvatarEditorService = game:GetService("AvatarEditorService")
local params = CatalogSearchParams.new()
params.SalesTypeFilter = Enum.SalesTypeFilter.TimedOptions
params.Limit = 10
local pages = AvatarEditorService:SearchCatalogAsync(params)
local results = pages:GetCurrentPage()
for _, item in results do
if item.TimedOptions then
for _, option in item.TimedOptions do
local days = option.Duration / 86400
print(string.format("%s: %d 天的 %d R$", item.Name, days, option.Price))
end
end
end

活動
PromptAllowInventoryReadAccessCompleted
功能: Players, AssetRead
AvatarEditorService.PromptAllowInventoryReadAccessCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptCreateOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptCreateOutfitCompleted(
result:Enum.AvatarPromptResult, failureType:Variant
參數
failureType:Variant

PromptDeleteOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptDeleteOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptRenameOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptRenameOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptSaveAvatarCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptSaveAvatarCompleted(
result:Enum.AvatarPromptResult, humanoidDescription:HumanoidDescription
參數
humanoidDescription:HumanoidDescription

PromptSetFavoriteCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptSetFavoriteCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

PromptUpdateOutfitCompleted
功能: Players, PlatformAvatarEditing
AvatarEditorService.PromptUpdateOutfitCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。