AlvareZ_ Posted July 2, 2013 Posted July 2, 2013 Client: close = guiCreateButton(312, 169, 266, 66, "Darmelo", false, GUIEditor.window[1]) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") function hola ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local arma = guiGridListGetItemText ( source, row, 1 ) if ( arma == "Jetpack" ) then triggerServerEvent ( thePlayer, "setJetpack", thePlayer ) end end end addEventHandler( "onClientGUIClick", close, hola, false) Server: function daselo() local yatiene = giveWeapon ( thePlayer, 41, 99999 ) outputChatBox ( "Tes has colocado el Spray!", thePlayer, 255, 0, 0, true ) if (yatiene) then outputChatBox ( "Ya tienes el Spray!", thePlayer, 255, 0, 0, true ) end end addEvent("setJetpack", true) addEventHandler("setJetpack", getRootElement(), darselo) Debug: 'addEventHandler' [Expected function at argument 2, got nil]
Alan.Alexander Posted July 2, 2013 Posted July 2, 2013 I would assume that in your client script, your GUI button "close" isn't being created properly giving a nil result.
iPrestege Posted July 2, 2013 Posted July 2, 2013 thePlayer is defined as localPlayer ? Server Side thePlayer is not defined anywhere .
AlvareZ_ Posted July 2, 2013 Author Posted July 2, 2013 this its not all script, its only the part of the error
iPrestege Posted July 2, 2013 Posted July 2, 2013 close is defined right? You create the button or what ever was this when the resource start?
Sasu Posted July 2, 2013 Posted July 2, 2013 --Client close = guiCreateButton(312, 169, 266, 66, "Darmelo", false, GUIEditor.window[1]) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") function hola ( ) if source == close then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local arma = guiGridListGetItemText ( source, row, 1 ) if ( arma == "Jetpack" ) then triggerServerEvent ( "setJetpack", localPlayer ) end end end end addEventHandler( "onClientGUIClick", root, hola) --Server function daselo() local yatiene = giveWeapon ( source, 41, 99999 ) if (yatiene) then outputChatBox ( "Tes has colocado el Spray!", source, 255, 0, 0, true ) else outputChatBox ( "Ya tienes el Spray!", source, 255, 0, 0, true ) end end addEvent("setJetpack", true) addEventHandler("setJetpack", getRootElement(), darselo)
Alan.Alexander Posted July 2, 2013 Posted July 2, 2013 this its not all script, its only the part of the error You are aware that with a limited view of what you're working with, we can only offer limited help, right?
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