Developer Product Error

Hello, so I have made the following code but Roblox keeps prompting me with this error message.
image

local marketplaceService = game:GetService("MarketplaceService")
local players = game:GetService("Players")

local player = players.LocalPlayer

local productShop = script.Parent
local scrollingFrame = productShop:WaitForChild("ScrollingFrame")
local template = scrollingFrame:WaitForChild("Template")

local productIDS = {
	1681205544,
}

local function PromptProduct(productID, buyButton)
	
	marketplaceService:PromptGamePassPurchase(player, productID)
	
end

task.wait(3)

for _, productID in productIDS do
	
	local productInfo = marketplaceService:GetProductInfo(productID, Enum.InfoType.Product)
	local newTemplate = template:Clone()
	newTemplate.Name = productInfo.Name
	newTemplate.ImageLabel.Image = "rbxassetid://"..productInfo.IconImageAssetId
	newTemplate.PriceLabel.Text = "R$"..productInfo.PriceInRobux
	newTemplate.Visible = true
	newTemplate.ID.Value = productID
	newTemplate.Parent = scrollingFrame
	
	
	newTemplate.BuyButton.MouseButton1Click:Connect(function()
		PromptProduct(productID, newTemplate.BuyButton)
	end)
end

How can I fix this?

2 Likes

For developer products, you need to use MarketplaceService:PromptProductPurchase, instead of MarketplaceService:PromptGamePassPurchase.

2 Likes

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