How do i check if a player bought a dev product?

So im trying to figure out how to check if a player bought a dev product but i can’t remember how, how can i do this?

remote.OnServerEvent:Connect(function(player, val)
	local questInfoF = player:WaitForChild("QuestInfo") 
	if val == "CancelQuest" then
		MPS.PromptProductPurchaseFinished:Connect(function(player,isPurchased)
			if Enum.ProductPurchaseDecision.PurchaseGranted == true then
				remote:FireClient(game.Players:GetPlayerByUserId(tonumber(player)), "CancelQuest")
			end
		end)
end)

Roblox has a really good tutorial on this, I’d recommend reading over this: Developer Products | Roblox Creator Documentation.

3 Likes