Google Play Leaderboard

Hello! I have a problem. I am a beginner in creating games, and the game I am working on now has a timer, which goes until you finish the game. The best time is saved. I took a script from the internet with leaderboard, but I want the best time to be put on the leaderboard, and I don’t know exactly how …
Can you help me,please?
6741043--776845--upload_2021-1-19_19-3-0.png

(TIMER SCRIPT)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIController : MonoBehaviour
{
    public Text timerS;
    public Text timer;
    private float time;
    private float msec;
    private float sec;
    private float min;

    public void Start()
    {
        timerS.text = PlayerPrefs.GetFloat("BestTime").ToString();
    }
    public void WatchStart()
    {
        StartCoroutine("StopWatch");
    }
    private void OnCollisionEnter(Collision collisionInfo)
    {
        if (collisionInfo.collider.tag == "Finish20")
        {
            Debug.Log("TIMER STOP");
            StopCoroutine("StopWatch");
            if (time > PlayerPrefs.GetFloat("BestTime"))
            { PlayerPrefs.SetFloat("BestTime", time); }

            if (time < PlayerPrefs.GetFloat("BestTime"))
            { PlayerPrefs.SetFloat("BestTime", time); }
        }
    }


    IEnumerator StopWatch()
    {
        while (true)
        {
            time += Time.deltaTime;
            msec = (int)((time - (int)time) * 100);
            sec = (int)(time % 60);
            min = (int)(time / 60 % 60);

            timer.text = string.Format("{0:00}:{1:00}:{2:00}", min, sec, msec);

            yield return null;
        }
    }
}


(GOOGLE PLAY SCRIPT)

using UnityEngine;
using System;
using GooglePlayGames;
using GooglePlayGames.BasicApi;


public class PlayServices : MonoBehaviour
{
    public int playerScore;
    string leaderboardID = "";
    string achievementID = "";

    void Start()
    {

        DontDestroyOnLoad(this);
        try
        {
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();
            Social.localUser.Authenticate((bool success) => { });
        }
        catch (Exception exception)
        {
            Debug.Log(exception);
        }
    }

    public void AddScoreToLeaderboard()
    {
        if (Social.localUser.authenticated)
        {
            Social.ReportScore(playerScore, "", success => { });
        }
    }

    public void ShowLeaderboard()
    {
        if (Social.localUser.authenticated)
        {
            Social.ShowLeaderboardUI();
        }
    }

    public void ShowAchievements()
    {
        if (Social.localUser.authenticated)
        {
            Social.ShowAchievementsUI();
        }
    }

    public void UnlockAchievement()
    {
        if (Social.localUser.authenticated)
        {
            Social.ReportProgress(achievementID, 100f, success => { });
        }
    }
}

I’ve never used Google Play Leaderboards, but I know that grabbing random scripts off the internet and hoping they will work is NOT actually software engineering. It might work, but how would you even know if it is even intended to be used with the current version of the Google API.

Instead, go to the official docs page for Google Leaderboards and understand the steps necessary. From there, go check out some Youtube tutorials on integrating that system, and from there develop functioning code, iterating and never going forward until you have each step proven to be functioning.