So I know how to prompt the purchase, and I know how to check if someone has it. But how do I check if someone bought it after the prompt purchase?
COMMUNITY QUESTION
How to check if someone bough the gamepass?
2 answers
You will have to check whether the gamepass /product own is true so you could do something like this
local hasPass = false
-- Check if the player already owns the game pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)
local market = game:GetService("MarketplaceService")
local plr = game:GetService("Players").LocalPlayer
local gamepass = 0 --change to your gamepass ID
if market:PlayerOwnsAssest(plr, gamepass) then
--put in the script where the player owns it
else
game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, gamepass)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
https://developer.roblox.com/en-us/api-reference/event/MarketplaceService/PromptPurchaseFinished :D