How to convert string to text?

This is my script that is assigned to Text (Legacy):

using UnityEngine;
using System;
using UnityEngine.UI;

public class Text : MonoBehaviour
{
public long score;
Text output;

void Start()
{
output = GetComponent();
output.text = "Score: " + score;
}
}

The UI should then display “Score: score”. I am using the Unity 2021.3.22f1 Personal version. I am a beginner. The error of this script is error CS1061(it is market red).

Thanks in advance for any help.

Thread is kinda old but nobody replied to you so I figured I’d answer. It’s likely because GetComponent didn’t find anything. Just to test this you can make it a serialized field and set the value in the editor.