Buy coins UI script not working

I tried to make a UI where you can buy extra coins using robux

it finishes the purchase but does not add any points
ServerscriptService script:

local mps = game:GetService("MarketplaceService")
local id = 1235674804
local id2 = 1235674834
local id3 = 1235674863

local function processReciept(receiptInfo)
	local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not  player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	if player then
		if receiptInfo.ProductId == id then
			player.leaderstats.points.Value = player.leaderstats.Points.Value + 100
		if receiptInfo.ProductId == id2 then
			player.leaderstats.points.Value = player.leaderstats.Points.Value + 1000
		if receiptInfo.ProductId == id3 then
			player.leaderstats.points.Value = player.leaderstats.Points.Value + 1500
	return Enum.ProductPurchaseDecision.PurchaseGranted

Textbutton script:

local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local id = 1235674804
	mps:PromptProductPurchase(player, id)

This script is in all the three buy buttons with different id’s

No errors just it won’t add money

Leaderstats value:

Did you make sure to put this at the bottom? This is what actually gets the information from MarketPlaceService & passes it on to the function named processReciept.

mps.ProcessReceipt = processReciept

You can also just do this instead of local function

mps.ProcessReceipt = function(receiptInfo)

in which script exactly?
and which line should I put it?

Since I said it’s what gets the info & passes it on to the function. It’s kinda clear I mean underneath the already existing function you have to handle the information. I also just updated it to mention you can just put it direction on the function instead of doing local function