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

How do you script a way to buy catalog items in-game?

Asked by 8 years ago

How do you script a way to buy catalog items in-game?

1 answer

Log in to vote
1
Answered by 8 years ago

To buy an item in game, do the following:

local market = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer -- note, this has to be a LocalScript for LocalPlayer to work.
local itemId = 00000

market:PromptPurchase(player,itemId)

http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService

Ad

Answer this question