I get a weird error when i try to use GUISkin on a timer

Ok well i googled the error and there was only one solution and it was c# so fooey. Well heres my script

var skin = GUISkin;

function OnGUI(){
	GUI.skin = skin;
	GUI.Box(new Rect(10, 10, 50, 25), "" + Ending.timer.ToString("0"));

and heres my error

Assets/Scripts/endScore.js(6,20): BCE0022: Cannot convert ‘System.Type’ to ‘UnityEngine.GUISkin’.

I don’t understand, sorry for the burden of such a silly question like this.

GUISkin is a class. When you say “var skin = GUISkin”. You are assigning the variable skin to a class type, not a class instance, which makes “skin” a System.Type. That is why it says “Cannot convert ‘System.Type’ to ‘UnityEngine.GUISkin’”.

You need to assign an instance of a GUISkin instead. Or don’t use a skin at all.

Change to var skin : GUISkin; (thanks @Lo0NuhtiK for adding that)