Have script detect which collider

Is there any way to have a script know if the player is in a specific collider?

i.e. if there is 4 room all with 4 box colliders, could you have 1 script and have it loop through depending on which room you are in? i.e.

If Box collider == 1 
{
  do something
}

In Javascript?

So this would identify that paticular collider how? Thanks & Sorry for misunderstanding

you chould just have diferent tags on the objects you are colliding with and just checking on your script like this:

void OnTriggerEnter(col Collider)

{
if(col.tag == “1”)
{
do something
}
if(col.tag == " 2")
{
do something else
}