Motor Sınıfı
AvatarEditorService
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Özet
Yöntemler
Olaylar
PromptCreateOutfitCompleted(result: Enum.AvatarPromptResult,failureType: Variant):RBXScriptSignal |
PromptSaveAvatarCompleted(result: Enum.AvatarPromptResult,humanoidDescription: HumanoidDescription):RBXScriptSignal |
API Referansı
Yöntemler
CheckApplyDefaultClothing
CheckApplyDefaultClothingAsync
AvatarEditorService:CheckApplyDefaultClothingAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parametreler
Dönüşler
ConformToAvatarRules
ConformToAvatarRulesAsync
AvatarEditorService:ConformToAvatarRulesAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parametreler
Dönüşler
GetAccessoryType
Parametreler
Dönüşler
GetAvatarRules
GetBatchItemDetails
GetBatchItemDetailsAsync
Parametreler
Dönüşler
GetBundlesByAssetIdAsync
Dönüşler
GetFavorite
GetFavoriteAsync
Parametreler
Dönüşler
GetHeadShapesAsync
Dönüşler
Kod Örnekleri
Kafa şekillerini alma
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
endGetInventory
GetInventoryAsync
Parametreler
Dönüşler
Kod Örnekleri
Son Tarihli Ürünleri Bulma
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 saat içinde sona eriyor", item.Name, hoursLeft))
end
end
endGetItemDetails
GetItemDetailsAsync
Parametreler
Dönüşler
Kod Örnekleri
Öğe Süresinin Kontrolü
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 saatten daha az süre içinde sona erecek!")
end
endGetOutfitDetails
GetOutfitDetailsAsync
Parametreler
Dönüşler
GetOutfits
GetOutfitsAsync
AvatarEditorService:GetOutfitsAsync(
Parametreler
| Varsayılan değer: "All" |
| Varsayılan değer: "All" |
Dönüşler
GetRecommendedAssets
GetRecommendedAssetsAsync
AvatarEditorService:GetRecommendedAssetsAsync(
Parametreler
| Varsayılan değer: 0 |
Dönüşler
Kod Örnekleri
Şapka Önerisi Alma
local AvatarEditorService = game:GetService("AvatarEditorService")
local assets = AvatarEditorService:GetRecommendedAssetsAsync(Enum.AvatarAssetType.Hat, 9255093)
for _, asset in ipairs(assets) do
print(asset.Item.Name)
endGetRecommendedBundles
GetRecommendedBundlesAsync
PromptAllowInventoryReadAccess
AvatarEditorService:PromptAllowInventoryReadAccess():()
Dönüşler
()
PromptCreateOutfit
AvatarEditorService:PromptCreateOutfit(
outfit:HumanoidDescription, rigType:Enum.HumanoidRigType, outfitOptions:Dictionary, outfitType:Variant
):()
Parametreler
| Varsayılan değer: "nil" |
outfitType:Variant |
Dönüşler
()
PromptDeleteOutfit
PromptRenameOutfit
PromptSaveAvatar
AvatarEditorService:PromptSaveAvatar(
):()
Parametreler
Dönüşler
()
PromptSetFavorite
AvatarEditorService:PromptSetFavorite(
):()
Parametreler
Dönüşler
()
PromptUpdateOutfit
AvatarEditorService:PromptUpdateOutfit(
):()
Parametreler
Dönüşler
()
SearchCatalog
SearchCatalogAsync
Parametreler
Dönüşler
Kod Örnekleri
Zamanlı Seçenekleri Olan Öğeleri Arama
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 gün için %d R$", item.Name, days, option.Price))
end
end
endOlaylar
PromptAllowInventoryReadAccessCompleted
AvatarEditorService.PromptAllowInventoryReadAccessCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal
Parametreler
PromptCreateOutfitCompleted
AvatarEditorService.PromptCreateOutfitCompleted(
Parametreler
failureType:Variant |
PromptDeleteOutfitCompleted
Parametreler
PromptRenameOutfitCompleted
Parametreler
PromptSaveAvatarCompleted
AvatarEditorService.PromptSaveAvatarCompleted(
Parametreler
PromptSetFavoriteCompleted
Parametreler
PromptUpdateOutfitCompleted
Parametreler