For dev products i take 2 scripts, 1 for showing up the thing to buy it and other to activitate when product bought, you are asking for think to show up so i will give a script from my game:
For dev products, btw make it a LocalScript:
local productId = 20973264 --My developer product ID
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
For gamepasses, also make it a LocalScript:
local id = 170502775 -- My Gamepass ID
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Text == "BUY" then
game:GetService("MarketplaceService"):PromptPurchase(player,id)
end
end) |