How to make a Shirt icon and Gamepass icon "ButtonImage"

hi hello everyone can anyone help me. about this problem
so the story is I want to make a game like pls donate but, I want to make an icon where when people Clam Stand a Shirt and Gamepass icon will appear. I’ve tried to make it but failed. can anyone help me???

Photo Stand:
image

Photo
image

Shirt Script:

local UrlA = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName="

local function getUserGeneratedTShirtsRecursive(username, SignPrices, tshirts, cursor)
	tshirts = tshirts or {}
	local requestUrl = UrlA
	local data = HttpService:JSONDecode(HttpService:GetAsync(UrlA .. username)).data
	if data then
		table.sort(data,
			function(a,b)
				return a.price < b.price
			end
		)
		for _, item in ipairs(data) do
			local e,s = pcall(function()
				table.insert(tshirts, item.id)
				local newBtn = script.Template:Clone()
				local price = item.price
				newBtn.PurchaseButton.Text = "$"..price
				--newBtn.PurchaseButton.ImageLabel.Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..newBtn.ImportantValues.AssetId.."&width=420&height=420&format=png"
				newBtn.LayoutOrder = price
				newBtn.Name = price
				newBtn.ImportantValues.AssetId.Value = item.id
				newBtn.Parent = SignPrices

			end)
		end
	end
	return tshirts
end

function AssetManager:GetAssets(Player, BoothUI)
	getUserGeneratedTShirtsRecursive(Player.Name, BoothUI)
end

return AssetManager

GamePass Script:

local UrlB = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=%s&userId=%s"

local function getUserCreatedGamepassesRecursive(userId, SignPrices, gamepasses, pageNumber, lastLength)
	gamepasses = {}
	pageNumber = pageNumber or 1
	lastLength = lastLength or math.huge
	local requestUrl = UrlB:format(pageNumber, userId)
	local success, result = pcall(function()
		return HttpService:GetAsync(requestUrl)
	end)

	if success then
		if result then
			local success2, result2 = pcall(function()
				return HttpService:JSONDecode(result)
			end)

			if success2 then
				if result2 then
					for _, gamepass in ipairs(result2.Data.Items) do
						if gamepass.Creator.Id == userId and table.find(gamepasses, gamepass.Item.AssetId) == nil then
							table.insert(gamepasses, gamepass.Item.AssetId)
							local e,s = pcall(function()

								local newBtn = script.Template:Clone()
								local price = gamepass.Product.PriceInRobux
								newBtn.Name = price
								newBtn.PurchaseButton.Text = "$"..price
								newBtn.ImageLabel.Image = "rbxassetid://"..gamepass.IconImageAssetId
								newBtn.LayoutOrder = price
								newBtn.ImportantValues.AssetId.Value = gamepass.Item.AssetId
								newBtn.ImportantValues.AssetType.Value = "Gamepass"
								newBtn.Parent = SignPrices
							end)
						end
					end
				else
					warn(result)
					getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
				end
			end
		else
			warn(result)
			getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
		end
		return gamepasses
	end
end
function AssetManager:GetAssets(Player, BoothUI)
	getUserCreatedGamepassesRecursive(Player.UserId, BoothUI)
end

return AssetManager
2 Likes

you did wrong code. it should be like this


				newBtn.ImportantValues.AssetId.Value = item.id
				newBtn.PurchaseButton.ImageLabel.Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..newBtn.ImportantValues.AssetId.Value.."&width=420&height=420&format=png"
				newBtn.Parent = SignPrices

2 Likes

whether this will work or not i have tried in other ways but failed

1 Like

yes this will not fail… You entered the wrong script

2 Likes

Thanks it works and is good @DeriNurmawan1

2 Likes

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