Hi there!
I ran into a problem, and I’ve been trying to solve it for two hours now. I’ve looked around for answer but I can’t find any. For others, this seem to work, but for me, it doesn’t.
Here’s the function containing the problem.
function createButton(songId, i: number)
local id = "rbxassetid://"..songId
local asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset)
local name = asset.Name
local clone = template:Clone()
clone.Name = "SearchResult" .. tostring(i)
clone.SongName.Value = name
clone.SongId.Value = id
clone.Play.Text = name
clone.Parent = guiList
end
And I can’t solve it. I just keep getting this error. No matter what i do.
I would really appreciate help. I need to have this plugin done today.
Edit:
According to this site, the error is caused by you sending too many requests. Try only doing :GetProductInfo once and then storing it in a table (you could use a module script for this)
There’s not enough information here. If you don’t provide any context or code or do any significant debugging yourself then we aren’t going to be able to help you well.
@GRADE_1000 The HTTP permission is only for HttpService to request to external servers. Any Roblox API that makes a web call does so with an internal service that does not require HttpEnabled and may access site endpoints without a proxy. That permission is irrelevant here.
Use a pcall function instead on local asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset). Because pcall will collect the error instead of printing it on the output. That things commonly happens when a id placed was incorrect or it gave up finding it on the internet.
I have also encountered this problem. I was helped by pcall. In your case, you can try this:
function createButton(songId, i: number)
local id = "rbxassetid://"..songId
local asset
local success, err = pcall(function()
asset = MarketplaceService:GetProductInfo(songId, Enum.InfoType.Asset)
end)
if success and asset then
local name = asset.Name
local clone = template:Clone()
clone.Name = "SearchResult" .. tostring(i)
clone.SongName.Value = name
clone.SongId.Value = id
clone.Play.Text = name
clone.Parent = guiList
else
print("not found")
end
end