Do a collider only with certain taged objects

Hi, I have done a little rutine to detect players that collide on a certain area, but I have the problem that monsters can enter too… So I want only to detect objects with the tag player:

Here is my code:

function OnTriggerEnter(Player : Collider) {
	if (numeroDePersonasEnElTanque==0){
		isPlayerVisible = true;
		isPlayerVisible  = false;

What function should I use to solve it?

if (player.gameObject.tag == “Player”) {…} or use CompateTag()

You can use GameObject.CompareTag - look at:

That’s the example they show:

// Immediate death trigger.
// Destroys any colliders that enter the trigger, if they are tagged player.
function OnTriggerEnter (other : Collider) {
if (other.gameObject.CompareTag ("Player")) {
Destroy (other.gameObject);