Error At Handling Transactions [DataStore]?
01 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
02 | local ds = game:GetService( "DataStoreService" ):GetDataStore( "PurchaseHistory" ) |
03 | local productId = 29974967 |
05 | MarketplaceService.ProcessReceipt = function (receiptInfo) |
07 | for i, player in ipairs (game.Players:GetChildren()) do |
08 | if player.userId = = receiptInfo.PlayerId then |
11 | if receiptInfo.ProductId = = productId then |
13 | player.Gems.Value = player.Gems.Value + 5 |
18 | local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId |
19 | ds:IncrementAsync(playerProductKey, 1 ) |
21 | return Enum.ProductPurchaseDecision.PurchaseGranted |
I do not use a leaderstats model (I put the variables in the player directly) and no errors in output, it keeps giving me an error when I try to purchase the dev. Product.