I don't know what is wrong. I have this in workspace in normal script. Scripts name: PurchaseHandler
local MarketplaceService = game:GetService("MarketplaceService")
local Points1=278389550 --Id
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == Points1 then
player.leaderstats.Points.Value=player.leaderstats.Points.Value+100
end
end
end
local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
PurchaseHistory:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end

1 comment
If you would read the whole script it is spelled right. View the whole script and you will see.