MarketplaceServiceクラス

クラスサービス(game:GetService("MarketplaceService")で取り出す)Instance.newでは作れない日本語解説あり

ひとことで言うと

ゲームパスや開発者製品など、ゲーム内での購入を扱うサービスです。

公式の説明(英語):The service responsible for in-experience transactions.

クラスの関係

受け継いでいるクラス:Object → Instance → MarketplaceService

メソッド(24)

名前と書き方説明
BindReceiptHandler
MarketplaceService:BindReceiptHandler(transactionType: ReceiptType, handler: Function, filter: Array?): RBXScriptConnection
Registers a callback to process receipts of a specific type.
GetDeveloperProductsAsync
MarketplaceService:GetDeveloperProductsAsync(): Instance
Returns a Pages object which contains information for all of the current experience's developer products.
GetProductInfoAsync
MarketplaceService:GetProductInfoAsync(assetId: int64, infoType: InfoType): Dictionary
Returns the product information of an asset using its asset ID.
GetRobloxSubscriptionDetailsAsync
MarketplaceService:GetRobloxSubscriptionDetailsAsync(user: Player): Dictionary
Returns the subscription details for the given user for the Roblox Subscription ecosystem.
GetSubscriptionProductInfoAsync
MarketplaceService:GetSubscriptionProductInfoAsync(subscriptionId: string): Dictionary
Returns the product information of a subscription for the given subscriptionId.
GetUsersPriceLevelsAsync
MarketplaceService:GetUsersPriceLevelsAsync(userIds: Array): List<PriceLevelInfo>
Returns the regionalized price levels of users, representing the recommended price for an item in each user's regional market.
GetUserSubscriptionDetailsAsync
MarketplaceService:GetUserSubscriptionDetailsAsync(user: Player, subscriptionId: string): Dictionary
Returns a table that contains the details of the user's subscription for a given subscriptionId.
GetUserSubscriptionPaymentHistoryAsync
MarketplaceService:GetUserSubscriptionPaymentHistoryAsync(user: Player, subscriptionId: string): Array
Returns an Library.table|Array that contains up to one year of the user's subscription payment history for the given subscriptionId.
GetUserSubscriptionStatusAsync
MarketplaceService:GetUserSubscriptionStatusAsync(user: Player, subscriptionId: string): Dictionary
Returns a table that contains the subscription status of the user for the given subscriptionId.
OpenShop
MarketplaceService:OpenShop(player: Player): ()
Opens a personalized in-game Shop for the given player.
PlayerOwnsAssetAsync
MarketplaceService:PlayerOwnsAssetAsync(player: Instance, assetId: int64): boolean
Returns whether the given user has the given asset.
PlayerOwnsBundleAsync
MarketplaceService:PlayerOwnsBundleAsync(player: Player, bundleId: int64): boolean
Returns whether the given player owns the given bundle.
PromptBulkPurchase
MarketplaceService:PromptBulkPurchase(player: Player, lineItems: Array, options: Dictionary): ()
Prompts a user to purchase multiple avatar items with the given assetId or bundleId.
PromptBundlePurchase
MarketplaceService:PromptBundlePurchase(player: Instance, bundleId: int64): ()
Prompts a user to purchase a bundle with the given bundleId.
PromptCancelSubscription
MarketplaceService:PromptCancelSubscription(user: Player, subscriptionId: string): ()
Prompts a user to cancel a subscription for the given subscriptionId.
PromptGamePassPurchase
MarketplaceService:PromptGamePassPurchase(player: Instance, gamePassId: int64): ()
Prompts a user to purchase a pass with the given gamePassId.
PromptProductPurchase
MarketplaceService:PromptProductPurchase(player: Instance, productId: int64, equipIfPurchased: boolean, currencyType: CurrencyType): ()
Prompts a user to purchase a developer product with the given productId.
PromptPurchase
MarketplaceService:PromptPurchase(player: Instance, assetId: int64, equipIfPurchased: boolean, currencyType: CurrencyType): ()
Prompts a user to purchase an item with the given assetId. Does not work for USD Creator Store purchases.
PromptRobloxSubscriptionPurchase
MarketplaceService:PromptRobloxSubscriptionPurchase(user: Player): ()
Prompts a user to purchase a Roblox Plus subscription.
PromptRobuxTransferAsync
MarketplaceService:PromptRobuxTransferAsync(sender: Player, receiverUserId: int64, amount: int64): string
Initiates a Robux transfer from the sender to another user.
PromptSubscriptionPurchase
MarketplaceService:PromptSubscriptionPurchase(user: Player, subscriptionId: string): ()
Prompts a user to purchase a subscription for the given subscriptionId.
RankProductsAsync
MarketplaceService:RankProductsAsync(productIdentifiers: Array): List<RankedItem>
Takes a list of product IDs and returns a personalized ordered list of those products.
RecommendTopProductsAsync
MarketplaceService:RecommendTopProductsAsync(infoTypes: Array): List<RankedItem>
- Takes an array of InfoType and returns up to 50 items representing the products a user is most likely to engage with and purchase.
UserOwnsGamePassAsync
MarketplaceService:UserOwnsGamePassAsync(userId: User, gamePassId: int64): boolean
Returns true if the player with the given Class.Player.UserId|UserId owns the pass with the given gamePassId.

イベント(8)

名前と書き方説明
PromptBulkPurchaseFinished
MarketplaceService.PromptBulkPurchaseFinished(player: Instance, status: MarketplaceBulkPurchasePromptStatus, results: Dictionary)
Fires when a purchase prompt for bulk avatar items is closed.
PromptBundlePurchaseFinished
MarketplaceService.PromptBundlePurchaseFinished(player: Instance, bundleId: int64, wasPurchased: boolean)
Fires when a bundle purchase prompt closes.
PromptGamePassPurchaseFinished
MarketplaceService.PromptGamePassPurchaseFinished(player: Instance, gamePassId: int64, wasPurchased: boolean)
Fires when a purchase prompt for a pass is closed.
PromptPremiumPurchaseFinished
MarketplaceService.PromptPremiumPurchaseFinished()
Fires when a purchase prompt for Roblox Premium is closed.
PromptProductPurchaseFinished
MarketplaceService.PromptProductPurchaseFinished(userId: int64, productId: int64, isPurchased: boolean)
Fires when a purchase prompt for a developer product is closed. Do not use this event to process purchases.
PromptPurchaseFinished
MarketplaceService.PromptPurchaseFinished(player: Instance, assetId: int64, isPurchased: boolean)
Fires when a purchase prompt for an affiliate gear sale or other asset is closed. Does **not** fire for developer product or pass prompts.
PromptRobloxSubscriptionPurchaseFinished
MarketplaceService.PromptRobloxSubscriptionPurchaseFinished(user: Player, didTryPurchasing: boolean)
Fires when a purchase prompt for Roblox Plus is closed.
PromptSubscriptionPurchaseFinished
MarketplaceService.PromptSubscriptionPurchaseFinished(user: Player, subscriptionId: string, didTryPurchasing: boolean)
Fires when a purchase prompt for a subscription is closed.

コールバック(1)

名前と書き方説明
ProcessReceipt
MarketplaceService:ProcessReceipt(receiptInfo: Dictionary): ProductPurchaseDecision
A callback to process receipts of developer product purchases.

受け継いでいるメンバー

Instance から受け継いでいるもの(46)

Archivable・Capabilities・IsInSandbox・Name・Parent・PredictionMode・Sandboxed・AddTag・ClearAllChildren・Clone・Destroy・FindFirstAncestor・FindFirstAncestorOfClass・FindFirstAncestorWhichIsA・FindFirstChild・FindFirstChildOfClass・FindFirstChildWhichIsA・FindFirstDescendant・GetActor・GetAttribute・GetAttributeChangedSignal・GetAttributes・GetChildren・GetDebugId・GetDescendants・GetFullName・GetStyled・GetStyledPropertyChangedSignal・GetTags・HasTag・IsAncestorOf・IsDescendantOf・IsPropertyModified・QueryDescendants・RemoveTag・ResetPropertyToDefault・SetAttribute・WaitForChild・AncestryChanged・AttributeChanged・ChildAdded・ChildRemoved・DescendantAdded・DescendantRemoving・Destroying・StyledPropertiesChanged

Object から受け継いでいるもの(4)

ClassName・GetPropertyChangedSignal・IsA・Changed

英語の説明とメンバーの一覧は、Roblox Creator Documentation(MarketplaceService)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。

執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。沖縄マイクラ部 クロスウェーブで、ロブロックス(Roblox)・マインクラフト(マイクラ)・Scratchなどのプログラミングを指導。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにロブロックス(Roblox)やマインクラフト(マイクラ)のプログラミングを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む