MarketplaceService Cancel Prompt and Prompted Event
As a Roblox developer, it is currently impossible to cancel a product purchase that was prompted without the user clicking “Cancel”, and we also don’t have the ability to see prompted purchases
The main use for this would be
Another place where it would be helpful is in the script builder games. Where users can run code and prompt purchases and developers can’t see what product it was prompted for, or if it’s for sale and costs Robux. And they can’t cancel the request either. So if someone is trying to scam others the developers can’t view or cancel the request to stop players from being scammed.
Possibly even just adding the events
MarketplaceService.ProductPurchasePrompted
and
MarketplaceService.GamePassPurchasePrompted
Which returns the product or game pass info for the item that was used in the prompt and an option to return something from a function on the event like Enum.PromptedPurchase.Cancel.
To be honest, this is a really niche use case. A better one may be:
If the prompt is on a player’s screen in a round-based game and a round begins, this function would be used to clear the screen and shift the player’s focus back to the game at hand.
As for script builder games, you as the developer is allowing potentially uncontrolled and dangerous code running in your game - since the code can’t just be executed with loadstring() anymore, unless enabled in ServerScriptService, then you have the ability to sandbox your code to monitor and restrict certain functionality, such as attempts to call MarketplaceService::PromptGamePassPurchase, MarketplaceService::PromptProductPurchase and MarketplaceService::PromptPurchase, can you not?
(There are custom loadstring modules made by some users to look into - of which the functionality to call a method with a list of arguments is necessary to exist somewhere in the code for you to change, if you want to restrict such functionality.)
I do think that Chipio’s use case seems valid, although it can also possibly cause bad UX for players who tries to purchase an item just as the round begins, just to have the popup dismiss without them interacting with it first.