Errors in script

I’m getting a few errors on my script.

using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;

public class Score : MonoBehaviour
{
	public FsmInt score = FsmVariables.GlobalVariables.GetFsmInt("Count");
	public FsmInt tryCount = FsmVariables.GlobalVariables.GetFsmInt("Score");
	public UILabel scoreLabel = GameObject.Find("Score").GetComponent<UILabel> ();
	public UILabel tryCountLabel = GameObject.Find ("Count").GetComponent<UILabel>();



	// Use this for initialization
	void Start ()
	{

	
	}
	
	// Update is called once per frame
	void Update ()
	{
		scoreLabel.text = score.Value.ToString ();
		tryCountLabel.text = tryCount.Value.ToString ();

	}
}

I tried doing this in playmaker but couldn’t figure out if it’s possible so I made a script.

You should not initialize the fields directly in the field declaration.

If you initialize fields in the declaration, the code is executed before the constructor is called (actually, its like “part of the constructor”). Unity is calling the constructor in a different thread and in parallel for all your objects, hence the error.

Instead, initialize the fields within void Awake() function