local DataStore = game:GetService("DataStoreService"):GetDataStore("ProductPurchases")
game:GetService("MarketplaceService").ProcessReceipt = function(ReceiptInfo)
local Purchasing_Player = game.Players:GetPlayerByUserId(ReceiptInfo.PlayerId)
if ReceiptInfo.ProductId == 33583689 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 2000
end
elseif ReceiptInfo.ProductId == 33580693 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 100
end
elseif ReceiptInfo.ProductID == 33583616 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 1000
end
elseif ReceiptInfo.ProductId == 33583667 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 1500
end
elseif ReceiptInfo.ProductId == 33580999 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 300
end
elseif ReceiptInfo.ProductID == 33583456 then
if Purchasing_Player and Purchasing_Player:FindFirstChild('leaderstats') and Purchasing_Player.leaderstats:FindFirstChild('Coins') then
print("Gamepass purchased")
Purchasing_Player.leaderstats.Coins.Value = Purchasing_Player.leaderstats.Coins.Value + 500
end
end
DataStore:IncrementAsync(ReceiptInfo.PlayerId .. '_' .. ReceiptInfo.ProductId, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Most of the 6 developer products that I have here work fine, but the ones for 1000 and 500 coins don't seem to be working and I was wondering if I could get some help with them? all of the other ones were working fine.
