switch betwen scripts on GetKeyDown

I don’t know how should i make that script :rage: , i know javascript.

I want to make a script, If someone press P that it runs 1st script, if he press again P that it runs 2nd script, if he press P again that it uns again the 1st script and all over again.

Then you probably know how to put the two scripts in two separate methods and use a toggle variable and an if statement to switch between them. Right?

I yust started with javascript, with i know javascript i ment i know how javascript works.

i made this script:

i want that if i press escape button that the script doesen’t work anymore, if i press escape again that it again works.