problem with script

using UnityEngine;
using UnityEngine.UI;

public class score : MonoBehaviour {

public Transform player;
public Text scoreText;

// Update is called once per frame
void Update () {
    scoreText.text = player.position.z.ToString();
}

}
please help i am folowing brackeys tuturiol (e7)

I appreciate the information and advice you have shared. I will try to figure it out for more.
Mysainsburys Portal

“Problem with script”, you defined nothing what is the problem?

score text is null or text is not working properly? Please define it more next time.

Have you provided the reference of the Text component of your text game object?