Engine-Klasse
AvatarEditorService
*Dieser Inhalt wurde mit KI (Beta) übersetzt und kann Fehler enthalten. Um diese Seite auf Englisch zu sehen, klicke hier.
Zusammenfassung
Methoden
Events
PromptCreateOutfitCompleted(result: Enum.AvatarPromptResult,failureType: Variant):RBXScriptSignal |
PromptSaveAvatarCompleted(result: Enum.AvatarPromptResult,humanoidDescription: HumanoidDescription):RBXScriptSignal |
API-Referenz
Methoden
CheckApplyDefaultClothing
CheckApplyDefaultClothingAsync
AvatarEditorService:CheckApplyDefaultClothingAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parameter
Rückgaben
ConformToAvatarRules
ConformToAvatarRulesAsync
AvatarEditorService:ConformToAvatarRulesAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parameter
Rückgaben
GetAccessoryType
Parameter
Rückgaben
GetAvatarRules
GetBatchItemDetails
GetBatchItemDetailsAsync
Parameter
Rückgaben
GetBundlesByAssetIdAsync
Rückgaben
GetFavorite
GetFavoriteAsync
Parameter
Rückgaben
GetHeadShapesAsync
Rückgaben
Code-Beispiele
Kopfformen erhalten
TEST
local AvatarEditorService = game:GetService("AvatarEditorService")
-- Fordert den Zugriff auf das Inventar an
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
Parameter
Rückgaben
Code-Beispiele
Ablaufende Gegenstände Finden
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 läuft in %d Stunden ab", item.Name, hoursLeft))
end
end
endGetItemDetails
GetItemDetailsAsync
Parameter
Rückgaben
Code-Beispiele
Überprüfung des Artikelablaufs
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 .. " läuft in weniger als 24 Stunden ab!")
end
endGetOutfitDetails
GetOutfitDetailsAsync
Parameter
Rückgaben
GetOutfits
GetOutfitsAsync
AvatarEditorService:GetOutfitsAsync(
Parameter
| Standardwert: "All" |
| Standardwert: "All" |
Rückgaben
GetRecommendedAssets
GetRecommendedAssetsAsync
AvatarEditorService:GetRecommendedAssetsAsync(
Parameter
| Standardwert: 0 |
Rückgaben
Code-Beispiele
Einen Hut Vorschlag erhalten
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():()
Rückgaben
()
PromptCreateOutfit
AvatarEditorService:PromptCreateOutfit(
outfit:HumanoidDescription, rigType:Enum.HumanoidRigType, outfitOptions:Dictionary, outfitType:Variant
):()
Parameter
| Standardwert: "nil" |
outfitType:Variant |
Rückgaben
()
PromptDeleteOutfit
PromptRenameOutfit
PromptSaveAvatar
AvatarEditorService:PromptSaveAvatar(
):()
Parameter
Rückgaben
()
PromptSetFavorite
AvatarEditorService:PromptSetFavorite(
):()
Parameter
Rückgaben
()
PromptUpdateOutfit
AvatarEditorService:PromptUpdateOutfit(
):()
Parameter
Rückgaben
()
SearchCatalog
SearchCatalogAsync
Parameter
Rückgaben
Code-Beispiele
Suche nach Artikeln mit zeitlich begrenzten Optionen
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 Tage für %d R$", item.Name, days, option.Price))
end
end
endEvents
PromptAllowInventoryReadAccessCompleted
AvatarEditorService.PromptAllowInventoryReadAccessCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal
Parameter
PromptCreateOutfitCompleted
AvatarEditorService.PromptCreateOutfitCompleted(
Parameter
failureType:Variant |
PromptDeleteOutfitCompleted
Parameter
PromptRenameOutfitCompleted
Parameter
PromptSaveAvatarCompleted
AvatarEditorService.PromptSaveAvatarCompleted(
Parameter
PromptSetFavoriteCompleted
Parameter
PromptUpdateOutfitCompleted
Parameter