MarketplaceModule talks to the PolyWorld catalog, gamepasses and badges for the current place's game, and creations.
Use it to prompt purchases, award badges, and check ownership, equipped clothing, or who created a place / catalog item / decal / mesh / model.
Available as the global MarketplaceModule.
Catalog clothing uses catalog ids. Gamepasses and badges use the Script ID from the place Edit page (one id per gamepass or badge row). Creations use a kind string plus that kind's own id — there is no shared asset-id space.
Overview
Methods
- :PromptPurchase(player: Player, catalogId: int)
- :PromptGamePassPurchase(player: Player, passId: int)
- :PlayerOwnsAsset(player: Player, catalogId: int) : bool
- :PlayerOwnsGamePass(player: Player, passId: int) : bool
- :AwardBadge(player: Player, badgeId: int) : bool
- :RewardedBadge(player: Player, badgeId: int) : bool
- :PlayerOwnsBadge(player: Player, badgeId: int) : bool
- :PlayerIsWearing(player: Player, catalogId: int) : bool
- :PlayerCreated(player: Player, kind: string, id: int) : bool
Events
- .PromptPurchaseFinished : Event (player: Player, assetId: int, bought: bool)
API
Methods
PromptPurchase
PromptPurchase(player: Player, catalogId: int) : void
Shows the buy prompt for a catalog item to that player.
On LocalScripts, player must be the local player.
MarketplaceModule:PromptPurchase(player, 42)
PromptGamePassPurchase
PromptGamePassPurchase(player: Player, passId: int) : void
Shows the buy prompt for a gamepass in the current place's game.
passId is the Script ID from Studio (Game → Gamepasses), not a catalog id.
On LocalScripts, player must be the local player (the client always prompts the local player).
MarketplaceModule:PromptGamePassPurchase(player, 3)
PlayerOwnsAsset
PlayerOwnsAsset(player: Player, catalogId: int) : bool
Returns true if the player owns the catalog item.
PlayerOwnsGamePass
PlayerOwnsGamePass(player: Player, passId: int) : bool
Returns true if the player owns that gamepass for this place's game.
Uses the same Script ID as :PromptGamePassPurchase.
AwardBadge
AwardBadge(player: Player, badgeId: int) : bool
Awards that badge to the player. Scripts only (not LocalScripts).
badgeId is the Script ID from the place Edit page (Badges), not a catalog id.
Returns true if the player has the badge after the call (newly awarded or already earned).
A new award shows a bottom-right notification with the emblem: You have been awarded the "Badge Name" badge!
MarketplaceModule:AwardBadge(player, 3)
RewardedBadge
RewardedBadge(player: Player, badgeId: int) : bool
Same as :AwardBadge.
PlayerOwnsBadge
PlayerOwnsBadge(player: Player, badgeId: int) : bool
Returns true if the player has already earned that badge.
Uses the same Script ID as :AwardBadge.
PlayerIsWearing
PlayerIsWearing(player: Player, catalogId: int) : bool
Returns true if the player currently has the catalog item equipped (head, shirt, pants, package, accessory, or emote).
PlayerCreated
PlayerCreated(player: Player, kind: string, id: int) : bool
Returns true if that player is the creator of the given creation.
kind is one of: "game", "place", "catalog", "item", "decal", "mesh", "model".
"place" is the same as "game". "item" is the same as "catalog".
Ids are per-kind (a decal 1 is not catalog 1).
if MarketplaceModule:PlayerCreated(player, "game", 20) then
print("place creator")
end
if MarketplaceModule:PlayerCreated(player, "decal", 8) then
print("made this decal")
end
Events
PromptPurchaseFinished
PromptPurchaseFinished : Event (player: Player, assetId: int, bought: bool)
Triggers when a catalog or gamepass purchase prompt closes.
The second argument is the catalog id or gamepass Script ID that was prompted.
bought is true only if the player completed the purchase.
