Is there a way to make a developer product that communicates with server?

I wanna know if there’s anyways to make a dev product that when bought it communicates to the server, I dont really wanna do a remote event cause exploiters might abuse them

You can handle whenever it’s bought on the server:

local MPS = game:GetService("MarketplaceService")

local function processReceipt(receiptInfo)
	local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)

	if not Player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

        -- do whatever

		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

MPS.ProcessReceipt = processReceipt

where do I put the product id?

you only need the product id for when you prompt it. you can prompt it anywhere even on the client.

MPS:PromptProductPurchase(plr, id)

if you wanna distinguish between them in the receipt function

local function processReceipt(receiptInfo)
	local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)

	if not Player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

		if receiptInfo.ProductId == id then
			-- do whatever
		elseif receiptInfo.ProductId == id then

		end

		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

Thanks for the help! I kinda forgot how to mess with marketplace lol

1 Like

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