how to script in different scenes?

hello. me again.

i want to know how how i can, lets say, play an animation for the camera, when it eneters another scene (using DontDestroyOnLoad).

wouldi type "if(Application.load(whatever){ play whatever}" ?

You can implement OnLevelWasLoaded on the object. It will get called every time a new level is loaded.

In the manual's code example, it checks the index of the level that was loaded to decide what to do:

function OnLevelWasLoaded (level : int) {
  if (level == 13) {
    print ("Woohoo");
  }
}

I don't recommend doing it that way- you risk breaking your game whenever you add a new scene or reorder scenes. It's usually safer to check the level's name using Application.loadedLevelName, unless you are in the habit of renaming your levels. The code is easier to read as well:

function OnLevelWasLoaded (level : int) {
  if (Application.loadedLevelName == "MainMenu") {
    // etc.
  }
}