I have the part that prompts you in the textbutton where it should be but now this wont work. I need help fixing or if its not broken could someone tell me where it should be

local productId = 24735683
local MarketplaceService = game:GetService("MarketplaceService")
 
MarketplaceService.ProcessReceipt = function(receiptInfo)
player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        if player.userId == receiptInfo.PlayerId then
     if receiptInfo.ProductId == productId then
    player.PlayerGui.Money.MonV.Value = player.PlayerGui.Money.MonV.Value + 500
            end
        end
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted    
end