I am trying to make a PlayerPoints system but the purchase prompt won't appear when the GUI button is clicked. What am I missing here?
local plr = game.Players.LocalPlayer
local productId = 19664516
script.Parent.MouseButton1Click:connect(function()
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, 5)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end)

1 comment
...