Problems with destroy

I’ve got an issue with destroy not existing in the current context. By script (C#) I create a gameobject and wish to destroy it. I’ve tried several approaches, trying to attach a script and then kill it through the script, like this:

public void kill()
	Destroy (this);

called in the creating script via:

thing.GetComponent<killscript> ().kill ();

or in the script that created it like this:


The creating script is not a monobehavior but the script I’m trying to attach is. Nothing works, what am I missing?

To call Destroy from outside a MonoBehaviour you need to call