เรียนรู้
Engine Class
AvatarEditorService
ไม่สามารถสร้าง
บริการ

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
วิธีการ
CheckApplyDefaultClothing(humanoidDescription: HumanoidDescription):HumanoidDescription
เลิกใช้แล้ว
ConformToAvatarRules(humanoidDescription: HumanoidDescription):HumanoidDescription
เลิกใช้แล้ว
GetAvatarRules():Dictionary
เลิกใช้แล้ว
GetBatchItemDetails(itemIds: {any},itemType: Enum.AvatarItemType):{any}
เลิกใช้แล้ว
GetFavorite(itemId: number,itemType: Enum.AvatarItemType):boolean
เลิกใช้แล้ว
GetInventory(assetTypes: {any}):InventoryPages
เลิกใช้แล้ว
GetItemDetails(itemId: number,itemType: Enum.AvatarItemType):Dictionary
เลิกใช้แล้ว
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 เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ