-
What do you want to achieve?
a part with a imagelabel displaying the icon of any game id -
What is the issue?
Error: “Unable to assign property Image. Content expected, got nil - Server - Script:21” -
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.