AvatarEditorService

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

作成できません
サービス
複製されていません

AvatarEditorService は、開発者のアバターエディタをサポートするサービスです。プレイヤーのプラットフォームアバターを変更したり、ユーザーのインベント持ち物リストに関する情報をリクエストしたり、カタログに関するリクエストをリクエストするメソッドを提供します。

For more information regarding the Avatar Editor, see アバターエディタサービス .

スロットリング

AvatarEditorService の次のエンドポイントには、エクスペリエンスレベルのスロットがあります:

各エクスペリエンスで、このスロット制限を使用すると、サーバーの数やユーザーの数にかかわらず、AvatarEditorServiceのこれらのエンドポイントに最大 100 個のリクエストを送信できます。これらの制限を超えると、429 Too Many Requests エラーが返されます。

エクスペリエンスがこのスロットを調整する必要があることを発見した場合は、機能リクエスト を送信できます。

概要

方法

イベント

プロパティ

方法

GetAccessoryType

パラメータ

avatarAssetType: Enum.AvatarAssetType

戻り値

PromptAllowInventoryReadAccess

void

開発者がユーザーのインベントリと他のアバターエディタに関するアイテムを読み込むために、Players.LocalPlayer に許可を請求します。プロンプトは、AvatarEditorService:GetInventory()、Class.AvatarEditorService


戻り値

void

PromptCreateOutfit

void

Class.Players.LocalPlayer を呼び出し、HumanoidDescription を衣装として保存します。AvatarEditorService.PromptCreateOutfitCompleted イベントを聞くことなく、結果を取得できます。結果は、1>Class.AvatarEditorService.PromptCreateOutfitCompleted1> イベントを聞くことで取得できます。

パラメータ

プレイヤーによって作成される Outfit

枚数.RigType は、プレイヤーがプロンプトを確認した場合に作成される衣装。


戻り値

void

PromptDeleteOutfit

void

Class.Players.LocalPlayer に、AvatarEditorService.PromptDeleteOutfitCompleted を削除するように指示します。結果は生成されません。Class.AvatarEditorService.PromptDeleteOutfitCompleted イベントを聞くと、結果を取得できます。

パラメータ

outfitId: number

削除する衣装の outfitId。


戻り値

void

PromptRenameOutfit

void

Class.Players.LocalPlayer に、AvatarEditorService.PromptRenameOutfitCompleted の名前を変更するように指示します。結果はありません。Class.AvatarEditorService.PromptRenameOutfitCompleted イベントを聞くことで、結果を取得できます。

パラメータ

outfitId: number

服装の outfitId をリネームする。


戻り値

void

PromptSaveAvatar

void

この関数は、Players.LocalPlayer に、HumanoidDescription および Enum.RigType (R6 または R15) を基にアバターを更新するように求めます。1>SaveAvatarCompleted1> イベントを聞くことなく、結果を取得できます。これは、<

パラメータ

humanoidDescription: HumanoidDescription

Class.HumanoidDescription が保存されるように求められています。

アバターがプロンプトを確認した場合、保存する Enum.RigType が。


戻り値

void

PromptSetFavorite

void

この機能は、Players.LocalPlayer に、アセットまたはバンドルをお気に入りまたはお気に入り解除を求めます。

パラメータ

itemId: number

アイテムをお気に入りに追加するアイテムのアイテムIお気に入り登録。

お気に入りにするアイテムのタイプ。

shouldFavorite: bool

戻り値

void

PromptUpdateOutfit

void

Class.Players.LocalPlayer により、Class.Players.LocalPlayer により、Class.Players.LocalPlayer により、1>Class.Players.LocalPlayer1> により、4>Class.Players.LocalPlayer4> により、7>Class.Players.LocalPlayer7> により、0>Class.Players.LocalPlayer0> により、3>Class.Players.LocalPlayer3> により、6>Class.Players.LocalPlayer6> により、Players.LocalPlayer9> により、2>

パラメータ

outfitId: number

更アップデートする衣装の outfitId。

updatedOutfit: HumanoidDescription

新しい服装データを表示するヒューマノイドの説明。

人間形のリグタイプを更新する。


戻り値

void

CheckApplyDefaultClothing

イールド

必要に応じて更新された Shirt と Pants プロパティを持つ新しい HumanoidDescription を返します。デフォルトの服装が必要ない場合は、HumanoidDescriptionを返します。

人形の説明には、現在 Shirt と Pants を装備していない場合、およびボディの色が同じすぎる場合があります。

パラメータ

humanoidDescription: HumanoidDescription

ヒューマノイドの説明は、デフォルトの服装が必要かどうかをチェックするのに使用されます。


戻り値

デフォルトの服装が必要な場合は、HumanoidDescription を返します。そうでない場合は、nil を返します。

ConformToAvatarRules

イールド

パラメータ

humanoidDescription: HumanoidDescription

戻り値

GetAvatarRules

イールド

この関数は、スケーリング、デフォルトのシャツとパンツ、アクセサリーの数など、プラットフォームのアバタールールを返します。

返されたテーブルには、次のフィールドが含まれています:


{
"PlayerAvatarTypes": [
"R6"
],
"Scales": {},
"WearableAssetTypes": [
{
"MaxNumber": 0,
"Id": 0,
"Name": "string"
}
],
"BodyColorsPalette": [
{
"BrickColorId": 0,
"NexColor": "string",
"Name": "string"
}
],
"BasicBodyColorsPalette": [
{
"BrickColorId": 0,
"HexColor": "string",
"Name": "string"
}
],
"MinimumDeltaEBodyColorDifference": 0,
"ProportionsAndBodyTypeEnabledForUser": true,
"DefaultClothingAssetLists": {
"DefaultShirtAssetIds": [
0
],
"DefaultPantAssetIds": [
0
]
},
"BundlesEnabledForUser": true,
"EmotesEnabledForUser": true
}

戻り値

スケーリング、デフォルトのシャツとパンツ、アイテムの着用可能なアセットの数など、プラットフォームのアバタールールを含む辞書。上のメインの説明で示す例を参照してください。

GetBatchItemDetails

イールド

一度にアイテムの詳細を取得するリストのアイテムの詳細を取得します。AvatarEditorService:GetItemDetails よりも効率的です。リストのアイテムの詳細をすべて取得する必要がある場合は。

パラメータ

itemIds: Array

詳細を取得するアイテム ID リスト。

提供されたアイテム ID の種類。


戻り値

次のフィールドでアイテムの詳細を返します:


{
"AssetType" = "string",
"CreatorName" = "string",
"CreatorTargetId" = 0,
"CreatorType" = "string",
"Description" = "string",
"FavoriteCount" = 0,
"Genres" = [
"All"
],
"Id" = 0,
"ItemRestrictions" = [
"Limited"
],
"ItemStatus": [
"New"
],
"ItemType" = "string",
"LowestPrice" = 0,
"Name" = "string",
"Price" = 0,
"ProductId" = 0
}

GetFavorite

イールド

この関数は、Players.LocalPlayer が指定されたバンドルまたはアセットをお気に入りにした場合に返ります。

パラメータ

itemId: number

指定されたアセットまたはバンドルの id。

指定されたアセットまたはバンドルの Enum.AvatarItemType


戻り値

LocalPlayer が、提供されたバンドルまたはアセットをお気に入りにしましたかどうか。

GetInventory

イールド

ユーザーのインベントリにあるアイテムの情報を含む InventoryPages オブジェクトを返します。 AvatarAssetTypes には、Enums.AvatarAssetType|AvatarAssetTypes が与えられています。

返されたテーブルには、次のフィールドが含まれています:


[
{
"AssetId": 0,
"AssetType" : "string",
"Created": "string",
"Name": "string",
}
]

パラメータ

assetTypes: Array

プレイヤーのインベントリでチェックできる Enum.AvatarAssetType


戻り値

GetItemDetails

イールド

この関数は、指定されたアイテムの詳細を返します。 2つのパラメーターを受け入れます - 最初はアイテムの取得IDを表示し、2番目はその Enum.ItemType を表します。

以下の形式でデータが返されました:


{
"IsForRent": true,
"ExpectedSellerId": 0,
"Owned": true,
"IsPurchasable": true,
"Id": 0,
"ItemType": "Asset",
"AssetType": "Image",
"BundleType": "BodyParts",
"Name": "string",
"Description": "string",
"ProductId": 0,
"Genres": [
"All"
],
"BundledItems": [
{
"Owned": true,
"Id": 0,
"Name": "string",
"Type": "string"
}
],
"ItemStatus": [
"New"
],
"ItemRestrictions": [
"ThirteenPlus"
],
"CreatorType": "User",
"CreatorTargetId": 0,
"CreatorName": "string",
"Price": 0,
"PremiumPricing": {
"PremiumDiscountPercentage": 0,
"PremiumPriceInRobux": 0
},
"LowestPrice": 0,
"PriceStatus": "string",
"UnitsAvailableForConsumption": 0,
"PurchaseCount": 0,
"FavoriteCount": 0
}

リミテッドまたは無限のアセットを検索するには、次の itemRestrictions 値を使用してください:

| itemRestrictions | 限定 または無制限 | | :--------------: | :-------------------: | | empty | Unlimited | | Collectible | Roblox Limited | Limited | Roblox Limited 無限 |

パラメータ

itemId: number

詳細が取得されているアイテムの ID。

アイテムの詳細を取得するタイプの値を指す枚数値。


戻り値

回収されたアイテムのアイテム情報を含むテーブル。上記のサンプルテーブルを参照してください。

GetOutfitDetails

イールド

この関数は、指定された服装の詳細を返します。 1つのパラメータを受け入れます:服装の ID です。

データは次の形式で返されます:


{
"Assets": [
{
"AssetType": {
"Id": 31,
"Name": "RightLeg"
}
"CurrentVersionId": 16447385805,
"Id": 11584239464,
"Name": "Anime Female - Right Leg"
}
],
"BodyColors": {
"HeadColor": Color3(204, 142, 105),
"LeftArmColor": Color3(204, 142, 105),
"LeftLegColor": Color3(204, 142, 105),
"RightArmColor": Color3(204, 142, 105),
"RightLegColor": Color3(204, 142, 105),
"TorsoColor": Color3(204, 142, 105)
},
"Id": 14703770624,
"IsEditable": true,
"Name": "Your Costume",
"OutfitType": "Avatar",
"PlayerAvatarType": "R15",
"Scale": {
"BodyType": 0,
"Depth": 1,
"Head": 1,
"Height": 1,
"Proportion": 0,
"Width": 1
},
}

パラメータ

outfitId: number

詳細が取得されている服装のID。


戻り値

回収された衣服のオートコスチューム情報を含むテーブル。上記のサンプルテーブルを参照してください。

GetOutfits

イールド

この関数は、Players.LocalPlayer の服装データを返します。これは、Players:GetHumanoidDescriptionFromOutfitId() で、プレイヤーのキャラクターを服装に更新するために使用されます。このアクセスは、AvatarEditorService:PromptAllowInventoryReadAccess() がユーザーに受

返されたテーブルには、次のフィールドが含まれています:


[
{
"Id": 0,
"Name": "string",
"IsEditable": true
}
]

<tbody>
<tr>
<td>id</td>
<td>int</td>
<td />
</tr>
<tr>
<td>名前</td>
<td>文字列</td>
<td />
</tr>
<tr>
<td>はEditable</td>
<td>ブールーン</td>
<td />
</tr>
</tbody>
名前タイ入力説明

パラメータ

outfitSource: Enum.OutfitSource
既定値: "All"
outfitType: Enum.OutfitType
既定値: "All"

戻り値

GetRecommendedAssets

イールド

Enums.AssetType とアセット ID を基にしたおすすめのアセットのリストを返します。これを使用して、アセットが提供するアセットと同様のアセットを集めます。以下のコードサンプルを参照して、この関数の可能な使用法について説明します。

データは次の形式です:


[
{
"Item": {
"AssetId": 0,
"Name": "string",
"Price": 0,
"PremiumPrice": 0,
},
"Creator": {
"CreatorId": 0,
"CreatorType": "string",
"Name": "string",
},
"Product": {
"Id": 0,
"PriceInRobux": 0,
"IsForSale": true,
"IsResellable": true,
"IsLimited": true,
"IsLimitedUnique": true,
"TotalPrivateSales": 0,
"OffsaleDeadline": "string",
"IsFree": true
}
}
]

パラメータ

アセットの種類の推奨を取得するためのリスト。 のみ、アイテムベースのリストに存在しない contextAssetId のリストに影響します。

contextAssetId: number

コンテキストで提案を取得するときに使用されているアセットのタイプに一致するアセットの id。

既定値: 0

戻り値

あなたに与えられた Enum.AssetType に基づくお勧めのリスト。

コードサンプル

This will return a list of similar hats much like how similar assets are displayed when viewing the catalog page on the website. The contextAssetId is optional and if not provided it will return some popular items from that category.

Getting a Hat Recommendation

local AvatarEditorService = game:GetService("AvatarEditorService")
local assets = AvatarEditorService:GetRecommendedAssets(Enum.AvatarAssetType.Hat, 9255093)
for _, asset in ipairs(assets) do
print(asset.Item.Name)
end

GetRecommendedBundles

イールド

この関数は、指定されたバンドル ID のためのおすすめのバンドルのリストを返します。

データは次の形式です:


[
{
"Id": 0,
"Name": "string",
"Description": "string",
"BundleType": "string",
"Items": [
{
"Owned": true,
"Id": 0,
"Name": "string",
"Type": "string"
}
],
"Creator": {
"Id": 0,
"Name": "string",
"Type": "string"
},
"Product": {
"Id": 0,
"Type": "string",
"IsPublicDomain": true,
"IsForSale": true,
"PriceInRobux": 0,
"PremiumPricing": {
"PremiumDiscountPercentage": 0,
"PremiumPriceInRobux": 0
}
}
}
]

パラメータ

bundleId: number

おすすめのバンドルのリスト。


戻り値

おすすめのバンドルが返されるバンドル ID。

SearchCatalog

イールド

この関数は、CatalogPages オブジェクトを返しますが、検サーチの結果を含まない。

返されたデータは形式を持っています:


[
{
"Id": 0,
"ItemType": "Asset",
"AssetType": "Image",
"BundleType": "BodyParts",
"Name": "string",
"Description": "string",
"ProductId": 0,
"Genres": [
"All"
],
"BundledItems": [
{
"Owned": true,
"Id": 0,
"Name": "string",
"Type": "string"
}
],
"ItemStatus": [
"New"
],
"ItemRestrictions": [
"ThirteenPlus"
],
"CreatorType": "User",
"CreatorTargetId": 0,
"CreatorName": "string",
"Price": 0,
"PremiumPricing": {
"PremiumDiscountPercentage": 0,
"PremiumPriceInRobux": 0
},
"LowestPrice": 0,
"PriceStatus": "string",
"UnitsAvailableForConsumption": 0,
"PurchaseCount": 0,
"FavoriteCount": 0
}
]

パラメータ

searchParameters: CatalogSearchParams

検サーチに使用されるパラメーターを含むオブジェクト。


戻り値

イベント

PromptAllowInventoryReadAccessCompleted

このイベントは、ユーザーが AvatarEditorService:PromptAllowInventoryReadAccess() のプロンプトに応答すると発動します。これは、ユーザーがウェブ要求を実行しないことによりのみ、 enum のステータスを返すことができます。

パラメータ

プロンプトの結果。


PromptCreateOutfitCompleted

このイベントは、プロンプト保存服装操作が完了したときに発生します。ステータス enum を指定して、プロンプトが成功したか、ユーザーに許可されていないかを示します。

パラメータ

プロンプトの結果。

failureType: Variant

PromptDeleteOutfitCompleted

プロンプト削除服装操作が完了したときに発動します。ステータス enum を表示して、プロンプトの成功、失敗、またはユーザーに付与されなかった権限を示します。

パラメータ

プロンプトの結果。


PromptRenameOutfitCompleted

プロンプトRenameOutfit オペレーションが完了したときに発動します。ステータス enum を指定して、プロンプトの成功、失敗、またはユーザーによる許可の有無を示します。

パラメータ

プロンプトの結果。


PromptSaveAvatarCompleted

このイベントは、AvatarEditorService:PromptSaveAvatar() オペレーションが完了したときに発動します。ステータス enum を指定して、プロンプトが成功したか、ユーザーによる許可が与えられなかったかを示します。

パラメータ

プロンプトの結果。

humanoidDescription: HumanoidDescription

PromptSetFavoriteCompleted

Class.AvatarEditorService:PromptSetFavorite() オペレーションが完了したときにファイアを起動します。ステータス enum を指定して、プロンプトの成功、失敗、または権限のないアクセスをユーザーに許可しなかったかどうかを示します。

パラメータ

プロンプトの結果。


PromptUpdateOutfitCompleted

Class.AvatarEditorService:PromptUpdateOutfit() オペレーションが完了したときに発動します。ステータス enum を提供して、プロンプトの成功、失敗、またはユーザーの権限のない許可を表示します。

パラメータ

プロンプトの結果。