When a player buys lets say the +50 player points, it does not give them 50 players points only 2...
I hid the numbers, so yeah please tell me what i'm doing wrong!
Is it because i had the extra comma at ["0"]=500,?
local Service = Game:GetService("PointsService")
local Products={
["0"]=2,
["0"]=5,
["0"]=10,
["0"]=50,
["0"]=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:SetAsync(PlayerProductKey, true)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
end
end

1 comment
How could i remove the purchase history safely?