I’m trying to make a script which automatically creates an entry in a Shop GUI, showing the robux price and the in-game coin price of the object. It cycles through every article within game.ServerStorage.Monetization.Gears using for i,v in pairs
. Although, on the first cycle, I get this error:
MarketplaceService:getProductInfo() failed because HTTP 400 (Bad Request)
Here is the snippet
for i, iteminshop in pairs(shopItems1) do
local ID = iteminshop.ID.Value -- Represents the ID of the gamepass
local info = Market:GetProductInfo(ID, Enum.InfoType.Product) -- THE LINE WHICH PRODUCES THE ERROR
if info then
robuxprice = info.PriceInRobux
else
print ("Could not assign price! - " .. iteminshop.Name)
end
local item = toEdit.Frame.UICorner.Item:Clone()
local RentPrice = iteminshop:FindFirstChild("RentPrice")
item.Name = iteminshop.Name
item.RobuxPrice.Text = robuxprice
item.Title.Text = iteminshop.Name
item.Image.Image = iteminshop.TextureId
item.Parent = shopFrame
item.Click.Enabled = true
if RentPrice then
item.RentPrice.Text = iteminshop.Price.Value
else
item.Coin:Destroy()
item.RentPrice:Destoy()
end
end
I have HTTP requests turned on in game settings although the error persits, what should I do?