Here I have a simple script that handles my ui
What it does?
It takes the ID and then create a new button showcasing the image of that asset and when the player clicks on it they wear that shirt everything seems alright but it wont show the image
local ShirtID = {7039707667} -- Shirt ID's HERE
local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local ShirtFrame = script.Parent.ScrollingFrame
local Button = ShirtFrame.ImageButton
local ToggleButton = script.Parent.HatButton
function SetShirt()
for i = 1, #ShirtID do
local ManualShirtId = ShirtID[i]
local ShirtData = MarketplaceService:GetProductInfo(ManualShirtId, Enum.InfoType.Asset)
local ShirtIcon = ShirtData.IconImageAssetId
local ShirtSlot = ShirtFrame:Clone()
local ShirtImage = ShirtSlot.ImageButton.Image
ShirtSlot.Parent = ShirtFrame
ShirtSlot.Name = ManualShirtId
ShirtImage = "rbxassetid://".. ShirtIcon
Button.MouseButton1Click:Connect(function()
--MarketplaceService:PromptGamePassPurchase(Player, man)
local PreOwnedShirt = Player.Character:FindFirstChildWhichIsA("Shirt")
if PreOwnedShirt then
PreOwnedShirt:Destroy()
local Shirt = Instance.new("Shirt")
Shirt.Parent = Player.Character
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..ManualShirtId
end
end)
end
end
local used = false
ToggleButton.MouseButton1Click:Connect(function()
if used == false then
ShirtFrame.Visible = true
used = true
else
ShirtFrame.Visible = false
used = false
end
end)
SetShirt()local ShirtID = {7039707667} -- Shirt ID's HERE
local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local ShirtFrame = script.Parent.ScrollingFrame
local Button = ShirtFrame.ImageButton
local ToggleButton = script.Parent.HatButton
function SetShirt()
for i = 1, #ShirtID do
local ManualShirtId = ShirtID[i]
local ShirtData = MarketplaceService:GetProductInfo(ManualShirtId, Enum.InfoType.Asset)
local ShirtIcon = ShirtData.IconImageAssetId
local ShirtSlot = ShirtFrame:Clone()
local ShirtImage = ShirtSlot.ImageButton.Image
ShirtSlot.Parent = ShirtFrame
ShirtSlot.Name = ManualShirtId
ShirtImage = "rbxassetid://".. ShirtIcon
Button.MouseButton1Click:Connect(function()
--MarketplaceService:PromptGamePassPurchase(Player, man)
local PreOwnedShirt = Player.Character:FindFirstChildWhichIsA("Shirt")
if PreOwnedShirt then
PreOwnedShirt:Destroy()
local Shirt = Instance.new("Shirt")
Shirt.Parent = Player.Character
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..ManualShirtId
end
end)
end
end
local used = false
ToggleButton.MouseButton1Click:Connect(function()
if used == false then
ShirtFrame.Visible = true
used = true
else
ShirtFrame.Visible = false
used = false
end
end)
SetShirt()
