Error Script

Hello!

I am from Spain and my English is so terrible but i try to explain me.

I have a problem with a Script. I am doing a tutorial from a website. In a moment, i have to write a .js script and i have to copy and paste, but the compiler said me that i have a error in the line 18. I don’t know how fix this problem. I paste the script and i say you the error:

You have to click in the link to watch the image where appear the error.

Please, I need help.

Thank you very much, and happy new year 2014!!!

Welcome to the forum.

You should post the script instead of a screenshot.

Ok.

I am new in the forum, i’m sorry.

----- Start Script ---------

var texto: GUIText; //el objeto texto que parpadeará
private var Fadetexttime : float = 0; //contador de tiempo
//Esta función nos permitirá setear varias variables al valor por defecto que deseemos cuando empiece la escena
function Start()
{
Globals.Lives = 3; Globals.Score = 0; Globals.Bulletlimit = 0;
}
function Update () { //Esta función se repetirá cada frame if(Input.GetButtonDown(“Jump”))
{
Application.LoadLevel(Globals.Levels + 1); //Si pulsamos el botón especificado como Jump(en mi caso será espacio o Boton B del mando de XBOX360) el juego cargará el próximo nivel y seremos transportados a éste.
}
if(Input.GetKeyDown(KeyCode.C))
{
Application.OpenURL(“http://elcazadordeleyendas.blogspot.com/”); //Si pulsamos el botón especificado (aquí, la tecla “C” del teclado), se abrirá el explorador por defecto y nos llevará a la página web especificada)
}
if(Input.GetButtonDown(“Exit”) || Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit(); //Si pulsamos la tecla indicada saldremos del juego
}
if(Fadetexttime < 1) {
Fadetexttime = Fadetexttime + 1 * Time.deltaTime; //mientras que nuestro contador tenga un valor inferior a 1, su valor sera sumado por el tiempo que ha pasado después del último frame
} else {
Fadetexttime = Fadetexttime + 1 * Time.deltaTime; //de lo contrario, no mostrará texto alguno
if(Fadetexttime >= 2) {
texto.text = “Pulsa espacio o el boton B para jugar”;
Fadetexttime = 0; //y si el tiempo es superior a 2, mostrará el texto otra vez y reiniciará el contador
}
} }

---------- End Script ---------

This is the Script. You can watch the error in the screenshot.

It’s tough to tell what “line 18” is in your screenshot (it’s pretty small), but I think it’s this line:

Application.Quit(); //Si pulsamos la tecla indicada saldremos del juego

Looking at the code you pasted above, it seems that you have an unwanted (and likely invisible) character at the beginning of that line. Notice the “OBJ” at the beginning of the line in your pasted code. Clean that up and see if it fixes your problem.

Jeff