Just downloaded the API so latest version.
[string "gui"]:70: attempt to index a nil value after running the following code
os.loadAPI("gui")
button = gui.createButton( "button", function() print("Hello World!") end ) --#This creates a new button with a function that when triggered will print "Hello World!"
button:draw( 1,1, 5, colors.green, colors.white ) -- #This draws the button at (1,1) with a width of 5. The first color is what the buttons color will be and the second color is the text color
button:toggle( colors.red,4) --#This toggles the buttons color to red for 4 seconds (If you leave the second argument as nil it will just toggle the button)
button:trigger() --#This triggers the buttons function
gui.detect( 1,3,true ) --#this checks an array of all the buttons you've defined and returns the name of the button. If you also set the third argument to true it will trigger that buttons action
It errors on button:trigger()











