Issue with prompt purchase?

I was doing a commission for making a shirt seller thing and for some reason I keep getting the same message when I buy a shirt using “PromptPurchase”?

It prints the correct shirt Id but nothing is still working and it’s a little hard to explain so I’ll just provide photos.

image
image
image

local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClothingToClient = ReplicatedStorage:WaitForChild("ClothingToClient")

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	local Id = script.Parent.Name
	local IsShirt = script.Parent.IsShirt.Value
	
	ClothingToClient:FireClient(player, Id, IsShirt)
end)

ClothingToClient.OnServerEvent:Connect(function(Player, Id)
	print(Id)
	MarketplaceService:PromptPurchase(Player, Id)
end)
1 Like

You probably have to Configure the item.

Item is public and on is currently on sale.

I believe there is a difference between a ShirtTemplate and the asset id of a shirt clothing item.

vs

2 Likes

I used the same method of using promptpurchase on another game with the ids from the shirt instance and it works fine there?

I don’t think you can purchase shirts in-game, I think this holds true for pants too. I believe you can only prompt purchases for developer products and gamepasses in-game, but perhaps I’m wrong.

Otherwise, get the ID of your Shirt from Catalog/Avatar Shop (not Studio). Use that ID to sell instead BUT keep using your current shirttemplate ID for your shirttemplate.

If you charged players with the template id, then you may have made them bought the wrong item, as one texture id can be an asset id. Texture id and asset id are separate, so if you upload an asset and get the asset id 5, the texture id can be 2, and if you try to prompt players for id 2 you prompt them to buy asset id 2. Do you see what I mean?


@bt5191 You are fully able to prompt players to purchase shirts and pants in-game, you just have to specify the correct asset id :smile:. This is found in the URL on the page, for example image - there, the asset id is 2726168898, and if you call MarketplaceService:PromptPurchase(player, id) with that asset id, it should work :slight_smile:

1 Like

No? Shirt and pants textures are assets. Their type is Image, and they’re literally the first thing on the list. https://developer.roblox.com/en-us/api-reference/enum/AssetType

(Keep in mind gamepasses are only listed because they used to be assets. Some still have an asset number associated under the old system or something.)

Edit: To clarify, texture id and pants id are separate, yes. Saying pants/shirt ids are asset ids is confusing here because the texture id is an asset, just not the one you’re looking for.

2 Likes

Do you add the asset ID into the ”(player, id)”?

1 Like