Accessing Array from Another script

Hi Guys I have an array in OneScript

public class LookUpScript : MonoBehaviour {
	public List<Transform> target;
}

I am trying to remove an object from this list from another script using the below code.

void ApplyDamagePlayer (float damage) {
		Destroy (gameObject);
		LookUpScript script = GetComponent<LookUpScript> ();
		script.target.RemoveAt (0);	
	}

But the above code is not working.
Could someone help?

gameObject is a property of every MonoBehavior that points to the GameObject that this script lives on.

The first thing you do in ApplyDamagePlayer is destroy the gameobject so the two lines of codes after it are never run.

It’s kind of hard for a function to do anything when the first line of code it runs destroys itsself.