callum123 Posted July 31, 2012 Share Posted July 31, 2012 (edited) I am new to scripting and have given it a try and I am trying to make a simple GUI script but I have a few errors and I am not sure why. The script may be completely wrong, but at least I am giving it a shot right? I am trying to create a simple GUI thing, where you click on the box and then the picture of what the wheel looks like will appear below as an image. I would like to make it so some is client side and some is server side, but not really sure how and for the cursor to appear when the GUI opens I have these following errors when I click anywhere in the GUI it closes for some reason I have to run the GUI once and press close and then start it up again for the pictures to actually change Debug errors: WARNING: Wheels\Wheels.lua:6: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] The errors are on every next sixth line of code after, so the problem is in all of them -Lua Deleted Would really appreciate a little bit of help, thanks Edited July 31, 2012 by Guest Link to comment
Castillo Posted July 31, 2012 Share Posted July 31, 2012 The problem is that you are adding the event before the function is created. Link to comment
callum123 Posted July 31, 2012 Author Share Posted July 31, 2012 Alright thanks, I fixed that Why does the GUI close when I click anywhere on the 'mainWindow'? Link to comment
Castillo Posted July 31, 2012 Share Posted July 31, 2012 Because of the "getPropagated" argument @ addEventHandler, you must set it to false, like this: addEventHandler("onClientGUIClick", offRoadB , offRoadF, false) Link to comment
callum123 Posted July 31, 2012 Author Share Posted July 31, 2012 Thanks very much for your help. I am now going to read a little bit more about the 'getPropagated', so I can learn from my mistakes Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now