In my game I want to script a buying prompt where a player can buy clothes off of a mannequin. I have everything set up for the script to work, but for some reason when I test buying clothes outside of studio on the published game, it would always return "this item is not currently for sale." The image is never of the full item but the decal that the item was based on. I don't know why the script sees my assets as decals instead of clothes. Also, the script can never load in the ImageID, and I don't know why. Help?!?
this script would load in the info from the clothes to a gui
OpenItemCard = game.ReplicatedStorage:WaitForChild("OpenItemCard")
function OpenItemCard.OnClientInvoke(ID,Body,ItemType,GroupType)
local Asset = game:GetService("MarketplaceService"):GetProductInfo(ID)
local InfoBox = Card.InfoBox
local ReXxInfoBox = Card.ReXxInfoBox
local OutletInfoBox = Card.OutletInfoBox
local Price = tostring(Asset.PriceInRobux)
local ImageID = tostring(Asset.IconImageAssetId)
local function GetItemInfo()
Card.InfoBox.Header.ItemName.Text = Asset.Name
Card.ReXxInfoBox.Header.ItemName.Text = Asset.Name
Card.OutletInfoBox.Header.ItemName.Text = Asset.Name
Card.Price.Text = Price.."R$"
Card.ItemImage.Image = ImageID
Card.Creator.Text = Asset.Creator.Name
Card.ItemInfo.Text = Asset.Description
print("Gathered Item Info for Card: "..Asset.Name)
end
end
local function TransferID()
Card.ID.Value = ID
print("Transferred Clothing ID: "..ID)
end
script inside the mannequin
Adornee = script.Parent.Parent.Parent.AdorneeAnchor
ID = string.sub(script.Parent.Parent.Parent.Body.Shirt.ShirtTemplate, 14) -- change if it does not fit the correct type of clothing
ItemType = 1 --(1 for shirts, 2 for pants)
GroupType = 1 --(1 for ReXx Studios, 2 for ReXx Outlet, 3 for Other)
script.Parent.MouseClick:Connect(function(plr)
print("Click Detected")
game.ReplicatedStorage.OpenItemCard:InvokeClient(plr, ID, Adornee, ItemType, GroupType)
print("ItemCard Loaded")
end)
Script inside the ImageButton
script.Parent.MouseButton1Click:connect(function()
local ID = script.Parent.Parent.Parent.ID.Value
local player = game.Players.LocalPlayer
game:GetService("MarketplaceService"):PromptPurchase(player,ID)
end)

2 comments
Is the script inside the image button local?
@incapaz That wouldn't cause the problem they are having.