End scene

The 2D forums are for posting 2D related questions (etc) and not for any problem you encounter when making a 2D game i.e. audio, scene-management, UI as those and many others have dedicated forums and will get more appropriate eyes on them which is better for you getting a response too.

Your post is just a general scripting question so you should make future posts like this in the dedicated scripting forum please.

Also note, when posting any code, even snippets, please use code-tags and not plain-text. You can also edit your post to include these too.

Thanks.