How to make a simple crafting system? (JS)

Hi! im java scripter but not that good.Will you guys help me with this crafting system? like in java script. just a simple crafting GUI with button slots on it.
example : when the item click on the button it will craft an item.

You mean like this?

var item : Gameobject;
var camera : Gameobject;

function GUI {


arghh! (I DONT GET IT!)

can you guys fix this code?
the FUNCTION thing.

the gui is:

// Mess around with these values to specify the width, height, And position

var X : int = 15; // X position
var Y : int = 15; // Y position
var H : int = 200; // button height
var W : int = 100; // button width

//This Function allows the GUI
function OnGUI(){
// This line of code draws the button
GUI.Button(Rect(X,Y,H,W), "This is what the button will say")

Oh and Don’t forget to add this script to the camera thats in you’re scene.
By the way this is Javascript.