Having Problems when scripting buy for Bundle Animation

What is wrong with this script.

I have Clicktobuy folder on workspace and much clicktobuy models and in them there is part with surfacegui

for i,v in pairs(workspace.ClickTobuy:GetChildren()) do
	local bundleId = v.Value.Value
	local AssetService = game:GetService('AssetService')
	local MarketplaceService = game:GetService('MarketplaceService')
	local BundleItems = AssetService:GetBundleDetailsAsync(bundleId).Items
	local FirstBundleInfo = MarketplaceService:GetProductInfo(BundleItems[1].Id)
	local OldBundleId = string.match(FirstBundleInfo.Description, "%d+")
	v.Part.SurfaceGui.TextButton.MouseButton1Down:Connect(function()
		MarketplaceService:PromptPurchase(game.Players.LocalPlayer, bundleId)
	end)
end

Edit:The error is

Internal error while fetching asset type because MarketplaceService:getProductInfo() failed because HTTP 400 (BadRequest)

Hello so what error is it giving you as we need that to help really.

i just added number values in every model btw this script is local script and in startergui

At PromptPurchase, you are trying to pass the incorrect variable. Pass OldBundleId instead of BundleId.

The bundle id that i wrote is 34.It works perfectly if i make when plr join event

Replace

MarketplaceService:PromptPurchase(game.Players.LocalPlayer, bundleId)

With

MarketplaceService:PromptPurchase(game.Players.LocalPlayer, OldBundleId)

Oh sorry my bad i didnt saw that i needed to write the oldbundle id Thanks!