the url works fine but it never goes through the data in the i, v in ipairs
local event = game.ReplicatedStorage.Main.LoadPlayerItems
local httpservice = game:GetService("HttpService")
event.OnServerEvent:Connect(function(player)
local gui = player.PlayerGui.PopUps.AddItems
local url = "https://catalog.roproxy.com/v1/search/items/details?Category=3&SortType=1"
local data = game:GetService("HttpService"):JSONDecode( game:GetService("HttpService"):GetAsync(url))
for i,v in ipairs(data) do -- it never goes through the data
local item = game.ReplicatedStorage.Main.Item:Clone()
item.Name = v.id
item.Parent = gui.ScrollingFrame
item.Id.Value = v.id
item.Inner.Title.Text = v.name
local newstring = string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", v.id)
item.Inner.Icon.Image = newstring
end
end)
As well as the change from ipairs to pairs, you also need to access the actual data part of the request. Here is a revised code.
local event = game.ReplicatedStorage.Main.LoadPlayerItems
local httpservice = game:GetService("HttpService")
event.OnServerEvent:Connect(function(player)
local gui = player.PlayerGui.PopUps.AddItems
local url = "https://catalog.roproxy.com/v1/search/items/details?Category=3&SortType=1"
local data = game:GetService("HttpService"):JSONDecode( game:GetService("HttpService"):GetAsync(url)).data -- i added .data
for i,v in pairs(data) do
local item = game.ReplicatedStorage.Main.Item:Clone()
item.Name = v.id
item.Parent = gui.ScrollingFrame
item.Id.Value = v.id
item.Inner.Title.Text = v.name
local newstring = string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", v.id)
item.Inner.Icon.Image = newstring
end
end)