How To Get Your Roblox Game Icon From A Roblox Script

Hey everyone, I need to know how to get the game icon from a script. Currently, I can only get the game thumbnail. Does anyone have any ideas on how to do this?

local GameIcon = "http://www.roblox.com/Thumbs/Asset.ashx?Width=512&Height=512&AssetID=".. GameId

Im getting this error

 MarketplaceService:getProductInfo() failed because HTTP 500 (Internal Server Error)

try this

local gameIconID = game:GetService('MarketplaceService'):GetProductInfo(game.PlaceId, Enum.InfoType.Asset)['IconImageAssetId']
local image = 'rbxassetid://'..gameIconID
2 Likes

oh that means there was an issue with server correction
the code i provided was a quick one so heres a fixed version

local placeId = game.PlaceId

local marketPlaceService = game:GetService("MarketplaceService")
local success, result = pcall(function()
	return marketPlaceService:GetProductInfo(placeId)
end)

if success then
	local iconId = result.IconImageAssetId
	script.Parent.Image = "rbxassetid://"..iconId
else
	warn(result)
end
1 Like