How to fix Product, Currency not adding?
I wanted to add products to my game that give gems when you buy them, I copied the scripts from an older game I made (where the products work) and added it ti the game im working on right now. but the products didn't work
Script in button:
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | game.MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, 1148720462 ) |
script in ServerScriptService:
1 | game.MarketplaceService.ProcessReceipt = function (reciptInfo) |
2 | local plr = game:GetPlayerByUserId(reciptInfo.PlayerId) |
3 | if reciptInfo.ProductId = = 1148720462 then |
4 | plr.leaderstats.Gems.Value = plr.leaderstats.Gems.Value + 250000 |
5 | return Enum.ProductPurchaseDecision.PurchaseGranted |
When I click the button the buy message pops up, when I click buy its says purshase succesfull but the gems aren't adding