Carrying a score through to the next scene

I know this is a prevalent question here on the Unity forums but I am hoping that my situation is different enough to warrant a question. I want to save the score the player received in one scene and display it in the next while adding on what they earn in the following scene. Here is the code I am working with:
using UnityEngine;
using System.Collections;

public class Deactivate : MonoBehaviour
{

public GUIText countText;
public GUIText winText;
public GUIText startText;
public GUIText coinText;
public float delayTime = 3;
private int count;
private int count2;

void Start ()
{
	countText.text = "Score: 0";
	coinText.text = "Gold: 0";
	startText.text = "";
	SetCountText ();
	winText.text = "";
}

void OnTriggerEnter(Collider other) 
{
	if(other.gameObject.tag == "PickUp")
	{
		other.gameObject.SetActive(false); 
		count = count + 100;
		count2 = count2 + 1;
		SetCountText ();
		audio.Play ();
	}
	if(other.gameObject.tag == "PickUp2")
	{
		other.gameObject.SetActive(false); 
		count = count + 500;
		count2 = count2 + 5;
		SetCountText ();
		audio.Play ();
	}
	if(other.gameObject.tag == "Enemy")
	{
		other.gameObject.SetActive(false); 
		count = count + 50;
		SetCountText ();
		audio.Play ();
	}
	if(other.gameObject.tag == "Boss")
	{
		other.gameObject.SetActive(false); 
		count = count + 5000;
		SetCountText ();
		audio.Play ();
	}
}
void SetCoinText ()
{
	coinText.text = "Gold: " + 0 + count2.ToString ();
}

}

I tried the DonotDestroyOnLoad method and it doubled up the code after a death and killed the player when it collected a coin. I hope there is a simple solution to this problem and and grateful for any help I receive.
Thanks.

The reason it doubled up is that you are loading a scene which already has that script, while keeping this one from the last scene. An easy way to prevent this is to run a search at Start() for the gameobject containing this script, and if it finds one, it destroys itself. That way, the 2nd script will delete itself leaving only the original one from the first scene.

I usually just use static variables for my scores. They maintain their value and can be accessed from any script. You can use PlayerPrefs too but a static int or float will do the trick :wink: