Hi Guys, so I used RoProxy for getting all the gamepasses and shirts a player created. My friend also created the same thing and almost the same code but his requests are fast enough and his requests doesn’t fail much. But for me, it fails almost everytime. I understand proxies can fail or be slow, but for my friend, it works fine. Why could be RoProxy so slow for me?
(Code is just some pcalls [2 pcalls only and reasonable] and functions where it clones)
We need the code… If you can give us that, we can assist you but we can give you conjectures for days but we can’t do anything with finality if we don’t have the code.
There isn’t anything special to help with. As I said above, my code works but I don’t understand why the request fails almost every time. I could send you the original code after some time if you could wait. Sorry for taking so much time.
local bindables = script.Parent.Parent.BindableEvents
local http = game:GetService("HttpService")
local MPS = game:GetService("MarketplaceService")
local shirttable = {}--get all the shirts here
local passtable = {}
function getAllItems(name, userid)
print("entered function")
local shirts = "https://catalog.roproxy.com/v1/search/items/details?Category=34&CreatorName="..name -- to get all the shirts
local passes = "https://web.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=1&userId="..userid -- get all the passes
--using pcall to make sure error doesn't happen
local success, result, result1 = pcall(function()
return http:GetAsync(shirts), http:GetAsync(passes)
end)
if success then
print("success")
local success2, shirt, pass = pcall(function()
return http:JSONDecode(result), http:JSONDecode(result1)
end)
if success2 and shirt and pass then
for i, shirtid in pairs(shirt.data) do
print(shirtid.id)
table.insert(shirttable, shirtid.id)
end
for i, passid in pairs(pass.Data.Items) do
if passid.Creator.Id == userid and passid.Product.IsForSale == true then
print(passid.Item.AssetId)
table.insert(passtable, passid.Item.AssetId)
end
end
end
else
warn("It errors")
end
return shirttable, passtable
end
function clonePasses(content, boothname)
for i,v in pairs(content) do
local data = MPS:GetProductInfo(v, Enum.InfoType.GamePass)
if data and data.IsForSale then
local gui = workspace[boothname].Products.Template:Clone()
gui.Parent = workspace[boothname].Products[boothname].ScrollingFrame
gui.Text = data.PriceInRobux.."$"
gui:SetAttribute("Id", v)
gui:SetAttribute("Type", "Gamepass")
end
end
end
function cloneShirts(content, boothname)
for i,v in pairs(content) do
local data = MPS:GetProductInfo(v, Enum.InfoType.Asset)
if data and data.IsForSale then
local gui = workspace[boothname].Products.Template:Clone()
gui.Parent = workspace[boothname].Products[boothname].ScrollingFrame
gui.Text = data.PriceInRobux.."$"
gui:SetAttribute("Id", v)
gui:SetAttribute("Type", "Shirt")
end
end
end
bindables.GetAssets.Event:Connect(function(player, boothname)
local shirt, pass = getAllItems(player.Name, player.UserId)
if shirt and pass then
clonePasses(pass, boothname)
cloneShirts(shirt, boothname)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
if script.Parent.Parent.Cube.Claim.Owner.Value == player then
script.Parent.Parent.Title.SurfaceGui.TextLabel.Text = "unclaimed"
script.Parent.Parent.Cube.Claim.Enabled = true
for _, button in pairs(script.Parent.Parent.Products[script.Parent.Parent.Name].ScrollingFrame:GetChildren()) do
if button:IsA("TextButton") then
button:Destroy()
end
end
end
end)
Hmm, that’s weird. There doesn’t seem to be any problems in the code. Maybe it’s based on the amount of requests being sent to the roproxy at the same time?
My guess (from experience): it’s a proxy. It’s hosted by some random person on the devforum, it’s not completely reliable. You’re essentially relying on a single point of error to give your information. It works better sometimes than other times.
Best way to do it is to host a proxy yourself, precoded proxies already exist if you don’t know how to code them.
I understand. But why it really works for my friend very well, I don’t really get it. He also have almost the same code. From your point of view, it’s his luck? I think.
Yes, it’s RoProxy and the problem isn’t yielding here. The part of code you highlighted could only run when everything is loaded. My main problem is that many times it fails to get the response. It works well for my friend although.
The title implies that RoProxy is running slow or taking a long time per response. I suggested it was actually MarketplaceService:GetProductInfo. Now it’s just that the responses error?