For whatever reason this does not award the player their player points they bought, and it does not show any error in the debug. Any idea?
This works with buying extra cash, but not player points for some reason, even tried prints and nothing showed up.
local Service = Game:GetService("PointsService")
local Products={
["0"]=2,
["0"]=5,
["0"]=10,
["0"]=50,
["0"]=500
}
local Prompt = 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
for i, v in pairs(Products)do
if tostring(Receipt.ProductId)==i then
Service:AwardPoints(Player.userId, v)
Prompt:IncrementAsync(PlayerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
end
end

1 comment
Such bold, much wow.