OnGUI not working

I was going to make a GUI for my project today. So I made a JavaScript called testGui.js

This is my code:

function OnGUI()
    if (GUI.Button(new Rect(10,10, 100, 100), "Test")) {


But when I add it to the camera game object it I get an error:

MissingMethodException: Method not found: 'GUI.Button'.


Is your script called GUI? If it is it will hide the real functions…