How to create ONE script that can change levels

Hello, I am making a game called square runner which is a platformer game. I have this code when they touch the floor at the bottom the level resets. However, with every new scene comes with a new script and it’s bugging me. Here is my code

function OnTriggerEnter()
{
Application.LoadLevel ("Level1");
}

I have to create that code for every scene. How can I make it so I only need one code that can change levels? Thanks for your help!

i think you should use a game object that doesn’t destroy through different scenes , and put your condition for changing levels on the script that is attached to this game object

DontDestroyOnLoad(target: Object): void;