onready var scoreText = get_node("ScoreText")
scoreText.text = "0"
func setscoretext (score):
scoreText.text = str(score)
What error are you getting?
That means get_node("ScoreText") is returning null. You likely have the node path wrong. Show what your node setup looks like.
I don't see any "ScoreText" node there. get_node("ScoreText") looks for a node that's a child of the node the code is running on. Since your code says extends Control, I'm guessing maybe it's on "UI"?
If you have a ScoreText node somewhere underneath your UI, then you need to use the full path to it.