Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I create a purchase gui?

Asked by
iGalio 10
10 years ago

I want to make a buy gui, so that when someone clicks a button they can buy the clothing item. I don't want to use a free model, because I designed my own mannequin.

1 answer

Log in to vote
2
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

This snippet of code will prompt the user to purchase the product of your choosing when the block your script is in is clicked:

local ProductID = 123456789
Instance.new("ClickDetector", script.Parent)

script.Parent.ClickDetector.MouseClick:connect(function(player)
    game:GetService("MarketplaceService"):PromptPurchase(player, ProductID)
end)
Ad

Answer this question