Help

You need change

scoreText = player.position.z.ToString("0");

to

scoreText.text = player.position.z.ToString("0");

And please edit subject topic to more informative.
Also, please use Code Tags
** Using code tags properly **

Learning to use documentation will be your next step. You will save tons of time, rather than waiting on the forum for the answer.
https://docs.unity3d.com/ScriptReference/UI.Text-text.html