I can't fix this error!

I have an error in a script that’s supposed to stop the GUI from distorting on maximized screen. Here’s the code:

void Start() {
    transform.position = Vector3.zero;
    transform.localScale = Vector3.zero;
    var guiTex = GetComponent<GUITexture>();
    guiTex.pixelInset = new Rect(Screen.width - 138, Screen.height - 138, -512, -256);
}

but here’s the error i get:
Assets/GUILock.cs(1,6): error CS0116: A namespace can only contain types and namespace declarations

I don’t see whats wrong with it!

Check in using lines above those and see if there is a semicolon missing.

Is that your entire script? You need it inside of a Monobehavior class. I bet it isn’t in one.

Also it can be useful to google error messages. This one shows up as many of my first results, and always shows that the problem is people putting their methods/variables outside of the class declaration.