Help getting game icon

I’m making a random game roulette but the game icon doesnt work

https://gyazo.com/23a2420a860825e5f8e9393dce7c66d1

local Icon = "rbxassetid://"..MarketplaceService:GetProductInfo(PlaceId).IconImageAssetId

Help pls

1 Like

https://www.roblox.com/asset-thumbnail/image?assetId=ASSETIDHERE&width=420&height=420&format=png

i cant, the id always return 0

Just use game.PlaceId property to get the place ID of the current place.

https://developer.roblox.com/en-us/api-reference/property/DataModel/PlaceId

im not trying to get the place id, im trying to get the game icon id

local Icon = "https://www.roblox.com/asset-thumbnail/image?assetId="..game.PlaceId.."&width=420&height=420&format=png"

IconImageAssetId is the icon of the gamepass/product not the game. It returns 0 if one isn’t set.
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo

it doesnt work


image

Oh icon, not thumbnail. one moment.

Open the icon in a new tab, then copy the icon’s ID in the URL. Then paste it into the script.

i cant, the script generates a place id, and then tries getting the icon id

"rbxthumb://type= GameIcon&id="..game.PlaceId.."&w=150&h=150"

didnt worked :confused:


image

now it works, instead of using PlaceId i used UniverseId ty so much

@vParkuu

Errors, for me. Probably doing something wrong.
Please post the line and keep in mind to always post the solution when you figure something out.

Thanks!

You will need ProxyService

local ProxyService = require( -- Module Path -- )
local Proxy = ProxyService:New( -- Arguments -- )

local PlaceId = 606849621
local UniverseId = game.HttpService:JSONDecode(Proxy:Get('https://api.roblox.com/universes/get-universe-containing-place?placeid='..PlaceId).body)

local ImageLabel = -- ImageLabel/Button Path --
local Icon = "rbxthumb://type=GameIcon&id="..UniverseId["UniverseId"].."&w=512&h=512"
ImageLabel.Image = Icon
1 Like