Devproduct id not working

I have the right asset id for my devproduct but for some reason it’s giving me the error: Argument 2 missing or nil, all my other ones in the same script work except the last one.

Script:

local marketplaceService = game:GetService("MarketplaceService")
local localPlayer = game.Players.LocalPlayer

local function promptDonoPurchase(amount)
	local devProducts = {
		["5"] = 1746850210,
		["10"] = 1746850863,
		["25"] = 1746851262,
		["50"] = 1746851797,
		["100"] = 1746852037,
		["500"] = 1746852293,
		["1000"] = 1746852532,
		["10000"] = 1746852743
	}
	
	marketplaceService:PromptProductPurchase(localPlayer, devProducts[amount])
end

for _,btn in pairs(script.Parent:GetChildren()) do
	if btn:IsA("TextButton") then
		btn.MouseButton1Down:Connect(function()
			promptDonoPurchase(btn.Name)
		end)
	end
end

devProducts[amount] is returning nil.

Amount is btn.Name

promptDonoPurchase(btn.Name)

It looks to me that you have a button which has a name that doesn’t exist in the devProducts table.

Yep, this was the issue the button was named 10k instead of 10000

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