Engine-klasse
AvatarEditorService
*Deze inhoud is vertaald met behulp van AI (bèta) en kan fouten bevatten. Klik hier om deze pagina in het Engels te bekijken.
Samenvatting
Methoden
Evenementen
PromptCreateOutfitCompleted(result: Enum.AvatarPromptResult,failureType: Variant):RBXScriptSignal |
PromptSaveAvatarCompleted(result: Enum.AvatarPromptResult,humanoidDescription: HumanoidDescription):RBXScriptSignal |
API-referentie
Methoden
CheckApplyDefaultClothing
CheckApplyDefaultClothingAsync
AvatarEditorService:CheckApplyDefaultClothingAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parameters
Teruggaves
ConformToAvatarRules
ConformToAvatarRulesAsync
AvatarEditorService:ConformToAvatarRulesAsync(humanoidDescription:HumanoidDescription):HumanoidDescription
Parameters
Teruggaves
GetAccessoryType
Parameters
Teruggaves
GetAvatarRules
GetBatchItemDetails
GetBatchItemDetailsAsync
Parameters
Teruggaves
GetBundlesByAssetIdAsync
Teruggaves
GetFavorite
GetFavoriteAsync
Parameters
Teruggaves
GetHeadShapesAsync
Teruggaves
Codevoorbeelden
Hoofdvormen verkrijgen
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
Parameters
Teruggaves
Codevoorbeelden
Vinden van vervallende items
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 vervalt over %d uur", item.Name, hoursLeft))
end
end
endGetItemDetails
GetItemDetailsAsync
Parameters
Teruggaves
Codevoorbeelden
Controleren van itemverval
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 .. " verloopt over minder dan 24 uur!")
end
endGetOutfitDetails
GetOutfitDetailsAsync
Parameters
Teruggaves
GetOutfits
GetOutfitsAsync
AvatarEditorService:GetOutfitsAsync(
Parameters
| Standaardwaarde: All |
| Standaardwaarde: All |
Teruggaves
GetRecommendedAssets
GetRecommendedAssetsAsync
AvatarEditorService:GetRecommendedAssetsAsync(
Parameters
| Standaardwaarde: 0 |
Teruggaves
Codevoorbeelden
Een Hoed Aanbeveling Krijgen
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():()
Teruggaves
()
PromptCreateOutfit
AvatarEditorService:PromptCreateOutfit(
outfit:HumanoidDescription, rigType:Enum.HumanoidRigType, outfitOptions:Dictionary, outfitType:Variant
):()
Parameters
| Standaardwaarde: nil |
outfitType:Variant |
Teruggaves
()
PromptDeleteOutfit
PromptRenameOutfit
PromptSaveAvatar
AvatarEditorService:PromptSaveAvatar(
):()
Parameters
Teruggaves
()
PromptSetFavorite
AvatarEditorService:PromptSetFavorite(
):()
Parameters
Teruggaves
()
PromptUpdateOutfit
AvatarEditorService:PromptUpdateOutfit(
):()
Parameters
Teruggaves
()
SearchCatalog
SearchCatalogAsync
Parameters
Teruggaves
Codevoorbeelden
Zoeken naar Items met Tijdgebonden Opties
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 dagen voor %d R$", item.Name, days, option.Price))
end
end
endEvenementen
PromptAllowInventoryReadAccessCompleted
AvatarEditorService.PromptAllowInventoryReadAccessCompleted(result:Enum.AvatarPromptResult):RBXScriptSignal
Parameters
PromptCreateOutfitCompleted
AvatarEditorService.PromptCreateOutfitCompleted(
Parameters
failureType:Variant |
Codevoorbeelden
Afhandelen van Outfit Creatie Resultaten
local AvatarEditorService = game:GetService("AvatarEditorService")
AvatarEditorService.PromptCreateOutfitCompleted:Connect(function(result, failureType)
if result == Enum.AvatarPromptResult.Success then
-- Outfit is aangemaakt
elseif result == Enum.AvatarPromptResult.PermissionDenied then
-- Gebruiker heeft de prompt afgewezen; negeer failureType
else -- Enum.AvatarPromptResult.Failed
if failureType == Enum.CreateOutfitFailure.OutfitLimitReached then
-- Vertel de gebruiker dat ze de outfitlimiet hebben bereikt
elseif failureType == Enum.CreateOutfitFailure.InvalidName then
-- Vertel de gebruiker een andere naam te kiezen
else -- Enum.CreateOutfitFailure.Other
-- Algemene fout; probeer opnieuw of toon een algemene foutmelding
end
end
end)PromptDeleteOutfitCompleted
Parameters
PromptRenameOutfitCompleted
Parameters
PromptSaveAvatarCompleted
AvatarEditorService.PromptSaveAvatarCompleted(
Parameters
PromptSetFavoriteCompleted
Parameters
PromptUpdateOutfitCompleted
Parameters