Look at line 23 PurchaseHistory:IncrementAsync(PlayerProductKey, 1), would that fix/work?
I was told to remove Purchase History, did i fix it? If not please tell me with an example how i could.
local Service = Game:GetService("PointsService")
local Products={
["19715096"]=2,
["19715101"]=5,
["19715110"]=10,
["19715119"]=50,
["19715122"]=500
}
local PurchaseHistory = Game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
Game:GetService("MarketplaceService").ProcessReceipt=function(Receipt)
local PlayerProductKey = Receipt.PlayerId.."_"..Receipt.PurchaseId
for _,Player in pairs(Game.Players:GetChildren())do
if Player.userId==Receipt.PlayerId then
if PurchaseHistory:GetAsync(PlayerProductKey)then
return Enum.ProductPurchaseDecision.PurchaseGranted
end
for i, v in pairs(Products)do
if tostring(Receipt.ProductId)==i then
Service:AwardPoints(Player.userId, v)
PurchaseHistory:IncrementAsync(PlayerProductKey, 1)--WOULD THAT WORK?
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
end
end
