Attempting To Fire an Event when a Developer Product is purchased

Hi, I am trying to create a fireworks event to be triggered by a developer product purchase. I have the fireworks event set up, and I am looking for the necessary steps to intertwine the purchase + event. Thank you

1 Like

You can have a server script that will handle all the devproducts in your game:

local marketService = game:GetService("MarketplaceService")
local playersService = game.Players

local products = {
	["productID"] = function(player)
		--do your stuff here
		return true
marketService.ProcessReceipt = function(receiptInfo)
	local player = playersService:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	local success,result = pcall(products[receiptInfo.ProductId],player)
	if not success or not result then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	return Enum.ProductPurchaseDecision.PurchaseGranted
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.