Using DevProducts on a TextButton?
I used a template for this but instead of a surface gui I need it to work on a TextButton. No Output besides "Place has to be opened with edit button to access DataStores"
01 | local MarketplaceService = Game:GetService( "MarketplaceService" ) |
02 | local ds = game:GetService( "DataStoreService" ):GetDataStore( "PurchaseHistory" ) |
03 | local productId = 19181612 |
04 | local cookiesincrease = 1000 |
08 | MarketplaceService.ProcessReceipt = function (receiptInfo) |
11 | for i, player in ipairs (game.Players:GetChildren()) do |
12 | if player.userId = = receiptInfo.PlayerId then |
15 | if receiptInfo.ProductId = = productId then |
17 | game.Workspace.cookies = game.Workspace.cookies + cookiesincrease |
23 | local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId |
24 | ds:IncrementAsync(playerProductKey, 1 ) |
27 | return Enum.ProductPurchaseDecision.PurchaseGranted |