Why does this work in the editor, but not as an .exe?

This code is attached to an empty gameobject and displays a gui text on screen on the the same coordinates as the object. It works fine when I test the scene in the editor, but when I compile it, it says something about HandleUtility and when I checked the reference, it says that scripts using HandleUtility must be located in Assets/Editor. I move it to the right directory and reattach the script to my object, but get some other errors instead.

Is this a bug? Is there a way to fix it or is there some different, better way to display a text over an object? I fiddled around with WorldToGUIPoint, but then the coordinates of the “label” are inverted.

var scrPt: Vector3;
var nodeGUI: HandleUtility;
var hud : GUISkin;

function OnGUI() {

	var scrPt = camera.main.WorldToScreenPoint (gameObject.transform.position);
		if (!Mother.knata  !Mother.klickeknapp)
		{
			GUI.Label(Rect(scrPt.x, scrPt.y, 400, 100), gameObject.name);
		}
	}

stuff from UnityEditor framework can not be used outside the editor, it does not exist there.

Ok, thanks for the reply. So is there a quick way of displaying a gui text that I can use instead of this? Like I said in my first post, WorldToGUIPoint inverts the coordinates. (I know, I’m a noob)

usage of ongui and the function you have is a way to go or guitext and position it by the WorldToScreenPoint