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

How do i make gui that people can buy my products from it ?

I need to put in my game VIP product that people could buy it I need help please conact me soon

2 answers

This largely depends on what type of product you are using. A t-shirt? Game pass? Developer Product?

1 comment

0

t shirt

Well, there are certain ways you have people buy items, they can touch something, click a GUI or click a brick with a clickdetector.

For example, here is when you click on a brick with a ClickDetector in the brick, it will have them buy the item with the ID

local productId = 19338327--Put the ID for the item here
script.Parent.ClickDetector.MouseClick:connect(function(player)
	Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) -- should pop up a dialog that prompts the player
end)

OR, if you want it to click a GUI you would do

local productId = 19338327
script.Parent.MouseButton1Click:connect(function(plr)--If the script was in the TextButton or ImageButton
	Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) -- should pop up a dialog that prompts the player
end)

Here is a ROBLOX wiki from PromptPurchase

http://wiki.roblox.com/index.php?title=PromptPurchase_(Method)

Hope this helped!

1 comment

0

i cant make it work

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