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

How To Use EquipIfPurchase On Marketplace?

Asked by 10 years ago

How to use equipifpurchased argument on this lua:

local productId = 1242353
game.Players.PlayerAdded:connect(function(player)
    Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
0
Why -1 If i need help? vincius0000 0 — 10y

1 answer

Log in to vote
0
Answered by
jobro13 980 Moderation Voter
10 years ago

The function definition is as following:

PromptProductPurchase( Instance player, int productId[, bool equipIfPurchased, CurrencyType currencyType] )

Everything between [] is optional. That means that equipIfPurchased is optional. If you would like to use it, you count the arguments: equipIfPurchased is the third argument. You want to equip when purchased? Then set the third argument to true. True is a boolean and is thus correct in this case.

Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId, true)

Ad

Answer this question