local productId = 19874388 local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) end)
It wont work when trying to insert 2 playerpoints into the game after bought a dev product.
Try this in a GUI Button:
local Market = Game:GetService("MarketplaceService") local Player = script.Parent.Parent.Parent.Parent local Assets = {19874388} script.Parent.MouseButton1Down:connect(function() Market:PromptProductPurchase(Player, Assets[1]) end) Market.PromptProductPurchaseFinished:connect(function(userId, assetId, Purchased) if userId == Player.userId then if Purchased == true then Player.leaderstats["Money"].Value = Player.leaderstats["Money"].Value + 2 wait(5) else end end end)