I found a script and model that sells clothes, and i tried changing it to how i need it to work and something is wrong. Basically i'm trying to get it to buy the clothes once you press a gui button.
local Buy = script.Parent
local ITEM_ID = 887227764 -- Here put the ID of the clothes you want to sell
Buy.MouseButton1Click:Connect(Clicked)
game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID)

3 comments
"MarketplaceService:PromptPurchase() player should be of type Player, but is of type nil" do you know how to fix this?
@Sniper2458 did you set p as the player? if not, local p = game.Players.LocalPlayer , if this is a localscript
This worked, thank you very much!