After multiple hours of trying to fix this issue I’ve come to no definitive conclusion and I’m wondering if anybody here in the DevForum might be able to offer some support.
The title of this post is the error I get in the Developer Console upon clicking a button within my game to purchase an outfit:
Internal error while fetching asset type because MarketplaceService:getProductInfo() failed because HTTP 400 (Bad Request)
Let me walk you through all the steps that my game does to this point.
By going into this GUI, you can access buttons to buy the shirt on display. The IDs for the assets being sold are located within each of the models in NumberValues, and then as each model is clicked, are sent to two values in the GUI so that the buttons can access them, like so:
Snippet from LocalScript inside StarterPlayerScripts
for _,v in pairs(workspace.ClothingModels:GetChildren()) do
if v:IsA("Model") then
v.ShirtPart.ClickDetector.MouseClick:connect(function(player)
-- If you click a part called 'ShirtPart' inside of the model...
purchaseGui.Visible = true -- GUI becomes visible
purchaseGui.ShirtValue.Value = v.ShirtValue.Value
purchaseGui.PantsValue.Value = v.PantsValue.Value
-- Values of the shirts and pants transfer over to the GUI
end)
end
end
Snippet from LocalScript inside of PurchaseGui
shirtButton.MouseButton1Down:Connect(function(player)
PromptPurchaseEvent:FireServer(player, frame.ShirtValue.Value)
end)
pantsButton.MouseButton1Down:Connect(function(player)
PromptPurchaseEvent:FireServer(player, frame.PantsValue.Value)
end)
-- Upon clicking the 'Buy Shirt' or 'Buy Pants' buttons, it prompts a purchase
Snippet from server script inside ServerScriptServices
local PromptPurchaseEvent = Remotes.PromptPurchaseEvent
PromptPurchaseEvent.OnServerEvent:Connect(function(player, id)
MarketplaceService:PromptPurchase(player, id)
end)
So that’s that. There you have all the code building up to this point. I’ll show you some other relevant screenshots…
This shows that the value does indeed transfer over from the model.
Security.
Developer console in a local server.
(Incidentally, the developer console is completely blank in normal servers.)
Would appreciate all help with this issue. Thank you. Let me know if there’s any more context I should add – first time posting in Scripting Support.