Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make it where, when a user clicks on the image, then they able to buy the clothing?

https://gyazo.com/013be0156065545c7b1275b0aeb77edc?token=cd72a0b72fb5deac53648107e9f978ae

https://gyazo.com/3e2f5bcf95255c81b5b7140dfb89bed4

local shirtId = 1361887013

script.Parent.ClickDetector.MouseClick:connect(function(player)
	Game:GetService("MarketplaceService"):PromptPurchase(player, shirtId)
end)
local pantsId = 1361888033

script.Parent.ClickDetector.MouseClick:connect(function(player)
	Game:GetService("MarketplaceService"):PromptPurchase(player, pantsId)
end)

1 answer

If you are using a gui you have to use something like this (it has to be an image button!) and it has to be a localscript inside the button

button = script.Parent
local pantsId = 1361888033

button.MouseButton1Click:connect(function()
	Game:GetService("MarketplaceService"):PromptPurchase(player, pantsId)
end)

2 comments

0

I only showed the detection code, things like marketservice you have to do yourself, I'll edit the script though

This discussion is preserved as it was. New answers, comments, and votes are closed.