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

0

Check the output. Any errors?

0

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.

0

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

0

'TextButton' may not be existant within 'SurfaceGui', judging by your error, is 'T-Shirt' the TextButton?

0

Yes

0

Then 'T-Shirt' may not be existant at the time when the code executes, try using the 'WaitForChild' method?

0

How do you do that? Plus even if I did that I am not sure if that is going to work

0

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

0

Where would I put this though?

0

Where would I put the 'WaitForChild' in? I am actually learning them for the first time (kinda)

0

Wait, can you give us the ID for the TShirt?

0

148438289