How To Stop Destroyer From Destroying?

Hey I have a question, how can I stop the destroyer(it’s a big quad that destroys all leftover gameobjects) from destroying certain game objects? You see i have power ups in the game that give me extra points, and every time the destroyer destroys them I get points for it, which of course i don’t want to happen. So how can stop the destroyer from destroying the power ups? Or how can I stop the power up from adding scores when destroyed by the destroyer? Here’s my destroyer script and power up script so you know what I’m talking about:

public class DestroyerScript : MonoBehaviour {
	
	HUDScript hud;
	

	void OnTriggerEnter2D(Collider2D other)
	{
		if (other.tag == "Player") 
		{
			Application.LoadLevel(1);
			return;
		}

		if (other.gameObject.transform.parent) 
		{
		    Destroy (other.gameObject.transform.parent.gameObject);
		} 
		else 
		{
			Destroy (other.gameObject);		
		}
	}
	
}

Powerup:

public class Powerup : MonoBehaviour {

	ScoringScript hud;
	
	void OnTriggerEnter2D(Collider2D other)
	{
		if (other.tag == "Player")
		Destroy (gameObject);
		{
			hud = GameObject.Find ("Character").GetComponent<ScoringScript> ();
			hud.IncreaseScore (3);
		}
	}
	
}

And the script that calculates my score:

public class ScoringScript : MonoBehaviour {
	
	float playerScore = 0;
	bool isPaused = false;
	public bool scoring = true;
	public float guiPlacementY1;
	public float guiPlacementX1;
	PlayerScript player;
	
	void Start()
	{
		player = GetComponent<PlayerScript >();
		scoring = true;
	}
	
	
	public void IncreaseScore(int amount)
	{
		playerScore += amount;
	}
	
	public void DecreaseScore(int amount)
	{
		playerScore -= amount;
	}
	
	
	void OnDisable()
	{
		PlayerPrefs.SetInt ("Score", (int)(playerScore * 5));
		PlayerPrefs.SetString("PlayerName", "High Score");
		PlayerPrefs.Save ();
		Debug.Log("Hide");
	}
	
	void OnGUI()
	{
		
		GUI.Label (new Rect(Screen.width * guiPlacementX1, Screen.height * guiPlacementY1, Screen.width * .5f, Screen.height * .4f), "Score: " + (int)(playerScore * 5));
	}
}

You have a mistake in powerup script:

       if (other.tag == "Player") Destroy (gameObject);
       {
           hud = GameObject.Find ("Character").GetComponent<ScoringScript> ();
           hud.IncreaseScore (3);
       }

With such placed braces, IncreaseScore() is called always, regardless of colliding objects. You need to move Destroy() into braces:

       if (other.tag == "Player")
       {             
           hud = GameObject.Find ("Character").GetComponent<ScoringScript> ();
           hud.IncreaseScore (3);
           Destroy (gameObject);  
       }

If I understand you correctly, you dont want your destroyer to destroy the powerups when they collide, right ?
So , I see you already use a tag to check whether the Player is colliding with the destroyer or something else, so what you could do is just use another if-condition to see if the “other” object is actually a powerup.

Lets say you put a tag on them called powerup,then you could add this line :

if (other.tag != "powerup")
{
  //Your existing code here
  /*
     if (other.gameObject.transform.parent) 
        {
            Destroy(other.gameObject.transform.parent.gameObject);
        } 
        else 
        {
           Destroy (other.gameObject);        
        }
   */
}

Also , i would add an else-statement after the if that checks if your Player is hit.

Hope i can help,
cheers,
T

Edit : and ofcourse what the Person before me suggested , namely the Destroy call in your powerup Needs to be inside the brackets.