So, I've been working on this thing. and for some reason, when I buy it, it doesnt give the player the currency they are owed? Help pls ;-;
Script 1(localscript in button)
local MarketPlace = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local ProductId = 1082680116
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
wait(1)
MarketPlace:PromptProductPurchase(player, ProductId)
end)
Script 2(script in serverscriptservice)
local MarketPlace = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local ProductId = (TheProductID)
local function proccessReciept(receiptInfo)
local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
--Player probably left
--if they come back, the callback with begin again
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
player:WaitForChild('leaderstats'):WaitForChild('RunSpeed').Value = player.leaderstats.RunSpeed.Value +80
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
Thers nothing in output either.

3 comments
Does your processReceipt function run in the first place? Where did you assign it to the ProcessReceipt function callback in MarketplaceService?
it says "Attempt to index nil with 'PlayerId' "?
And, i just added that (How did i forget it?? XD)