I tried the script out, but it is still not working for some reason. The reason why I asked this question was that I wanted to change the text button in TMM Credit Vendor to a shirt, t-shirt, etc vendor. And what it has in the workspace is Part,Surface GUI, and then with text buttons. What should I do then?
local Id = "ASSET NUMBER HERE"
script.Parent.TextButton.MouseButton1Click:connect(function(player) --Changed ClickDetector to TextButton
game:GetService("MarketplaceService"):PromptPurchase(player, Id)
end)

12 comments
Check the output. Any errors?
Check line one: The identifier 'Id' is set to '"ASSET NUMBER HERE"', when 'PromptPurchase' is calling 'Id', as a 'Number', but returns a string instead.
I put the ID in and it still won't work. And the error is this: 20:37:44.358 - TextButton is not a valid member of TextButton 20:37:44.360 - Script 'Workspace.Part.SurfaceGui.T-Shirt.Script', Line 3 20:37:44.361 - Stack End
'TextButton' may not be existant within 'SurfaceGui', judging by your error, is 'T-Shirt' the TextButton?
Yes
Then 'T-Shirt' may not be existant at the time when the code executes, try using the 'WaitForChild' method?
How do you do that? Plus even if I did that I am not sure if that is going to work
The 'WaitForChild' method waits for the Child, and will return it when it is existant [Parent:WaitForChild(Child)], also, you never know until you try! :D
Where would I put this though?
Where would I put the 'WaitForChild' in? I am actually learning them for the first time (kinda)
Wait, can you give us the ID for the TShirt?
148438289