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

How could I make a script that prompted a purchase?

Asked by 3 years ago

So in my game Choccy Milk Simulator I want to make a lemonade pet that costs 25 robux. But instead of a gamepass, I want it to be rebuyable. But all the tutorials online are only about prompting the purchase of a gamepass, so how would I create a purchase that could be bought again? I even checked the developer.roblox.com article about marketplace service, but that only talks about gamepasses.

1 answer

Log in to vote
2
Answered by
TickoGrey 116
3 years ago
local function promptPurchase()
    local player = Players.LocalPlayer
    MarketplaceService:PromptProductPurchase(player, productID)
end

the player is the player instance and productID is the ID of the developer product you can read more about both of them here: https://developer.roblox.com/en-us/articles/Developer-Products-In-Game-Purchases

Ad

Answer this question