How to change variable in parent script?

Hello everyone,
I have an Empty game object with a script attached that spawns my “coins”

I also have a simple coll detection script attached to my player body that detects when the coin is hit and the coin is set to not active.
That part seems to work fine.

I would now like my coll script to tell the Spawner Script that the coin “isDead” so that the script knows to respawn a new coin in the same spot after an elapsed set of time.

I will post both codes here. Keep in mind I haven’t put in the time delay for respawning as I’m not concerned with that part at the moment. I’m trying to get this code right first.

other.gameObject.transform.parent.GetComponent ("MySpawner").isDead = true; <<<-- this line gives me error

My bool “isDead” is that supposed to be public of private?
I also don’t understand when you need to instansiate as GameObject and when you don’t need to do that.

Thanks for reading!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ColDetection : MonoBehaviour {

private int score; //How much Pepecash you have

// Use this for initialization
void Start () {

	score = 0;
	}

// Update is called once per frame
void Update () {

	}

void OnTriggerEnter(Collider other)
{
	if (other.tag == "PepeCash")
	{
		other.gameObject.SetActive (false);
		score = score + 1;
		Debug.Log ("Score =" + score);
		other.gameObject.transform.parent.GetComponent ("MySpawner").isDead = true;

	}
}

}

And other script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MySpawner : MonoBehaviour {

public GameObject spawnAsset;
private GameObject newSpawnAsset;
public bool isDead;

// Use this for initialization
void Start () {
	isDead = false;

	newSpawnAsset = Instantiate(spawnAsset, transform.position, transform.rotation);

}

void Respawn ()
{ 
	if (isDead == true) {
		newSpawnAsset = Instantiate (spawnAsset, transform.position, transform.rotation);
		isDead = false;
	}

}

}

I suggest you create a new script called SpawnerScript and a Gameobject called Spawner, a private variable can’t be seen out side the class, even with .GetComponent<>() create a “Coin” Tag as well No quotes

using UnityEngine;

public class SpawnerScript : MonoBehaviour
{
//Prefab of coin
public GameObject coin;
private GameObject oldCoin;
float score = 0;
public static bool canSpawn = true;

private void Start()
{
    oldCoin = Instantiate(coin, transform.position, transform.rotation) as GameObject;
    oldCoin.tag = "Coin";
    canSpawn = false;
}

private void Update()
{
    if (canSpawn == true)
    {
        oldCoin = Instantiate(coin, transform.position, transform.rotation) as GameObject;
        oldCoin.tag = "Coin";
        canSpawn = false;
        Debug.Log("Score: " + score);
    }
}

}

Now create a Detection Script

using UnityEngine;

public class Detection : MonoBehaviour
{
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Coin")
        {
            GameObject.Find("Spawner").GetComponent<SpawnerScript>().canSpawn = true;
            Destroy(other.gameObject);
        }
    }
}