so for my game i want to make a party/clan system where you with a pass can set an custom image as clan logo from your inventory so i fetced it from the api with the user id but
1 it doesnt return other image if pagenumber is 2
2 it doesnt load in the image instead a blanc image
local function fetchPlayerImages(userId)
local apiUrl = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=13&cursor=&itemsPerPage=50&pageNumber=&userId=" .. userId
local success, response = pcall(function()
return HttpService:GetAsync(apiUrl)
end)
if success then
local data = HttpService:JSONDecode(response)
return data
else
warn("Failed to fetch player images from RoProxy:", response)
return {}
end
end
local function populateUI(data)
if data and data.Data.Items then
for _, imageInfo in ipairs(data.Data.Items) do
local item = imageInfo.Item
if item then
local assetId = item.AssetId
local name = item.Name
--print("AssetId:", assetId)
--print("Name:", name)
local newUI = template:Clone()
newUI.Parent = inventoryUI
newUI.Visible = true
newUI.bimg.Image = `rbxassetid://{assetId}` ---imageInfo.Thumbnail.Url
--warn(imageInfo.Thumbnail.Url)
newUI.dtitle.Text = name
newUI.trigger.trigger.MouseButton1Click:Connect(function()
-- Apply Image ID to selected instances
local selectedInstances = clanLogo
for _, instance in pairs(selectedInstances) do
if instance:IsA("ImageLabel") then
instance.Image = `rbxassetid://{assetId}`
end
end
--print("Applied Image ID:", assetId, "to selected instances.")
end)
end
end
end
end
local function start()
local images = fetchPlayerImages(userId)
populateUI(images)
end
start()
the script works fine but doesnt contain a image the rbxasset id show up trough