This stopped working after I put the v.Backpack.Plyr.IceOwnedline. Any ideas why?
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
CASHID = 20121128 --PUT ID HERE
MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_product_" .. receiptInfo.ProductId
local numberBought = ds:IncrementAsync(playerProductKey, 1)
for i,v in pairs (game.Players:GetChildren()) do
if v.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == CASHID then
game.ServerStorage.Ice:Clone().Parent = v.Backpack
v.Backpack.Plyr.IceOwned.Value = true
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end

1 comment
The output is 'doAcceptPurchase success from ypcall is true reason is nil'