What do you want to achieve?
I’m trying to make a list of players that buy an item from my game. (Any item, Gamepasses, Clothing, Accessories, etc.)
What is the issue? The issue is that I’m not sure or aware of any function or event that can detect whenever someone buys an item. I don’t have an issue making or adding people to the list, the only thing I’m interested in is how to detect when anyone buys an item from my game.
What solutions have you tried so far? I’ve looked for solutions on the MarketPlaceService page on the Developer Hub.
If anyone could please let me know how I can fix my issue that would be great!
Use PlayerOwnsAsset ? Now this is what I would use for Clothing and Accessories. If you are wanting gamepasses and developer products, then Use the default methods of UserOwnsGamePassAsync and ProcessReceipt Now you might be wondering this isn’t an event, but you could pair this with PromptPurchaseFinished assuming that you prompt it in game, and check if they own these assets and things (This is just an idea)… Hope this helps?
Thanks a lot, I used PromptPurchaseFinished for anyone wondering. Here’s the code I used
local MarketplaceService = game:GetService("MarketplaceService")
local function onPromptPurchaseFinished(player, assetId, isPurchased)
print("Player has purchased an Item!")
end
MarketplaceService.PromptPurchaseFinished:Connect(onPromptPurchaseFinished)