I have a dev product and I want something to happen when someone buys it, I searched up MarketplaceService in the api and found some functions that I thought would help me do that. This is my script so far:
local MarketPlaceService = game:GetService("MarketplaceService")
MarketPlaceService.PromptPurchaseFinished:Connect(function(Player, Id)
if MarketPlaceService:PlayerOwnsAsset(Player, Id) then
print("A player just bought something!")
end
end)
But when I playtest and buy said dev product it doesn’t print anything, no errors either.
Here https://developer.roblox.com/en-us/api-reference/class/MarketplaceService RBXScriptSignalPromptPurchaseFinished ( Instance player , int64 assetId , bool isPurchased ) Fires when a purchase prompt closes for an affiliate gear sale or other asset (does not fire for developer product or game pass prompts)
Please do not use any prompt finished API for doing this and please search before posting threads. You should have searched up “developer products” instead of MarketplaceService’s API first: there are articles available for showing you how to handle developer products.
If you aren’t trying to handle a purchase and just to show something visually or otherwise, then ignore this and continue on with using the prompt event.