Need help with script :[

this is the script i found on the internet only thing i want is this in it application.loadlevel(1); when you click it
the red area is the text that will popup when clicked on the picture

// Draws 2 buttons, one with an image, and other with a text
// And print a message when they got clicked.
var btnTexture : Texture;
function OnGUI() {
if (!btnTexture) {
Debug.LogError(“Please assign a texture on the inspector”);
return;
}
if (GUI.Button(Rect(0,0,250,250),btnTexture))
Debug.Log(Want level Switch here);
}

and then when i just put it in it gives me a compiler error

@Stolenbows
From the sounds of it, you want the level to load when the button is pressed. If that is the case, replace the Debug.Log line with
Application.LoadLevel( );
with the level number in the ( ).

For more info, check out the reference area.

Hope that helps,

-S

Whats the compiler error?
Edtit:
Cool looks like Sevisin got it :slight_smile:

that i need a ; at the end

Thankyou it worked!

@Stolenbows
The error is in the debug line.
Debug.Log(Want level Switch here);
should be
Debug.Log(“Want level Switch here”);
if you want the debug to print.

-S

it worked :]