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

How To Use EquipIfPurchase On Marketplace?

How to use equipifpurchased argument on this lua:

local productId = 1242353
game.Players.PlayerAdded:connect(function(player)
	Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

1 comment

0

Why -1 If i need help?

1 answer

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)

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