Assets/scripts/Coin.cs(10,36): error CS1656: Cannot assign to `Score' because it is a `method group'

Hi, I’m a noob at scripting and I just ran into a problem. I’m trying to access a function from another script and add 1000 to it when I touch a coin. The error I’m getting is “Assets/scripts/Coin.cs(10,36): error CS1656: Cannot assign to Score' because it is a method group”. What can I do to fix this?

Here is the script:

using UnityEngine;
using System.Collections;

public class Coin : MonoBehaviour {

    void OnCollisionEnter2D(Collision2D col){

	if(col.gameObject.tag == ("Player")){

		Leaderboard.LDRBRD.Score += 1000;

		Destroy(gameObject);
	}
  }
}

Thanks in advance!

Show your declaration of the Score. I bet it is something like this

public int Score()
{
  // do something
}

public void Score(int points)
{
  // do something
}

In scripting, you can’t assign to the methods of objects (unless you’re using javascript). For the .Score to be an assignable value from any other script, declare it this way:

public int Score { get; set; }