I am working on a script for my other account's cafe and I need some help. This is what I have so far:
local Market = game:GetService("MarketPlaceService") local id = 19932057 -- This is a developer product ID. function hi() Market:PromptProductPurchase(game.Players.LocalPlayer, id) end script.Parent.Button.MouseButton1Down:connect(hi)
Its not even giving me a prompt? What do I do?
This should work. Make sure it's a LocalScript
local MarketplaceService = Game:GetService("MarketplaceService") local productId = 19932057 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() MarketplaceService:PromptProductPurchase(player, productId) end)
--[[ WHAT YOU NEED: In the workspace, make a brick called BuyButton In the brick insert a SurfaceGui and name it SurfaceGui In the Gui, insert a TextButton and name it TextButton INSERT THIS SCRIPT INTO A LOCALSCRIPT IN THE STARTERPACK ]] while true do local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton buyButton.MouseButton1Click:connect(function() local productId = 19932057 Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end) end --Hope this helped! -- Made By Vividex
Didn't test it, quickly wrote it.