I need help with something that has only appeared today. I have been using a template that someone else has made but now that I use it today, it just sends a HTTPError:ConnectFail warning. Here is the code:
local HTTPService = game:GetService("HttpService")
local baseUrl = "https://catalog.roproxy.com/v1/search/items/details?Category=3&Subcategory=12&Limit=30&CreatorName=%s&cursor=%s"
local function getUserGeneratedTShirtsRecursive(username, tshirts, cursor)
tshirts = tshirts or {}
cursor = cursor or ""
local requestUrl = baseUrl:format(username, cursor)
local success, result = pcall(function()
return HTTPService:GetAsync(requestUrl)
end)
if success then
if result then
local success2, result2 = pcall(function()
return HTTPService:JSONDecode(result)
end)
if success2 then
if result2 then
for _, tshirt in ipairs(result2.data) do
table.insert(tshirts, tshirt.id)
end
cursor = result2.nextPageCursor
if cursor then
return getUserGeneratedTShirtsRecursive(username, tshirts, cursor)
else
return tshirts
end
end
else
warn(result)
end
end
else
warn(result)
end
end
and this is what calls it:
local Username = Player.Name
local UserTshirts = getUserGeneratedTShirtsRecursive(Username)
Player is defined by the way
All support is great. Thanks!