It does not give me 100 extra points?
I don't know what is wrong.
I have this in workspace in normal script.
Scripts name: PurchaseHandler
01 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
02 | local Points 1 = 278389550 |
03 | local PurchaseHistory = game:GetService( "DataStoreService" ):GetDataStore( "PurchaseHistory" ) |
05 | MarketplaceService.ProcessReceipt = function (receiptInfo) |
06 | for i, player in ipairs (game.Players:GetChildren()) do |
07 | if player.userId = = receiptInfo.PlayerId then |
08 | if receiptInfo.ProductId = = Points 1 then |
09 | player.leaderstats.Points.Value = player.leaderstats.Points.Value+ 100 |
13 | local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId |
14 | PurchaseHistory:IncrementAsync(playerProductKey, 1 ) |
15 | return Enum.ProductPurchaseDecision.PurchaseGranted |