Fetching game icon with roproxy

  1. What do you want to achieve?
    a part with a imagelabel displaying the icon of any game id
  2. What is the issue?

    Error: “Unable to assign property Image. Content expected, got nil - Server - Script:21”
  3. What solutions have you tried so far?
    using roproxy, and trying to use print commands to debug
local HttpService = game:GetService("HttpService")

local function getGameIconUrl(universeId)
	local url = "https://thumbnails.roproxy.com/v1/places/gameicons?placeIds="..universeId.."&returnPolicy=PlaceHolder&size=512x512&format=Png&isCircular=false"

	local response = HttpService:GetAsync(url)

	if response.StatusCode == 200 then
		local data = HttpService:JSONDecode(response)
		if data and data.data and #data.data > 0 then
			return data.data[1].imageUrl
		else
			return nil
		end
	else
		return nil
	end
end
local universeId = 10905034443
local decal = script.Parent
decal.Image = getGameIconUrl(universeId)

Im not very familiar with how http requests work and scripting as a whole, and im not even sure if this is possible. anything helps.

1 Like

You can use rbxthumbs, here’s the texture you need to use: “rbxthumb://type=GameIcon&w=150&h=150&id=GAMEID”

Here’s more info: Assets | Documentation - Roblox Creator Hub

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.