I made several DevProducts in my game that should give the player who bought them a little in-game currency. However, the game doesn't give the player their currency. Here's the code:
game:GetService("MarketplaceService").ProcessReceipt = function(purchaseInfo)
local plr = game:GetService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId)
if purchaseInfo.ProductId == 828036387 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 1000
elseif purchaseInfo.ProductId == 828613126 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 2500
elseif purchaseInfo.ProductId == 828614470 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 5000
elseif purchaseInfo.ProductId == 828615135 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 10000
elseif purchaseInfo.ProductId == 828615771 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 50000
elseif purchaseInfo.ProductId == 828616642 then
game.ServerStorage.PlayerMoney[plr.Name].Value = game.ServerStorage.PlayerMoney[plr.Name].Value + 100000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
I used "print()" to see where the code goes wrong, because there are no errors in the output. I found out that the script doesn't make it past line 2. Please help!
