So I have done this yet I'm not sure if it has worked or not.
This is in a script in the main Workspace
local plr = game.Players.LocalPlayer
local productId = 19664507
local market = game:GetService("MarketplaceService")
CASHID = 19664516 -- Put the Developer Product ID here
Game:GetService("MarketplaceService"):PromptProductPurchase(plr, productId)
local MarketplaceService = Game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
local PointsService = Game:GetService("PointsService")
local pointsToAward = PointsService:GetAwardablePoints()
local universeBalance = PointsService:GetGamePointBalance(plr.userId)
if (pointsToAward > 0 and universeBalance == 0) then
PointsService:AwardPoints(plr.userId, 1)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
This is in a Local Script on a Button GUI
local productId = 19664507 --Change this to your developer product ID!!
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
