Access to variable in other script (c#)

I’m trying to access a variable in a script attached to the “other” object in this trigger event but I cant figure out whats going wrong unity says “score does not exist in the current context.”

here are both scripts the one with the error;

using UnityEngine;
using System.Collections;

public class PickUp : MonoBehaviour {

	void OnTriggerEnter (Collider other)
	{
		other.GetComponent<ScoreAndPickUps>(score++);
		Destroy (gameObject);
	}

}

and the one its trying to access;

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class ScoreAndPickUps : MonoBehaviour {

	public int score;
	public int powerUp;
	public Text points;

	void Start ()
	{
		score = 0;
		Setpoints ();
	}

	void Setpoints ()
	{
		points.text = "Points: " + score.ToString ();
	}

}

Try instead of the line 8 in your PickUp Script :

other.gameObject.GetComponent<ScoreAndPickUps>().score++;

Well, it says that there is no score variable declared. You need to declare variable in order to use it.

And, I’m not sure that you can use generic GetComponent method with parameter like you are trying to do.