Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

It does not give me 100 extra points?

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 answer

✓ Accepted answer

I am not sure if this would help, but on line 9 you didn't spell a word correctly! Its Value not Valu I think :D

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.