Newbie Posted March 21, 2014 Share Posted March 21, 2014 Hey. I Gotta problem. bindKey('F7','down', function ( ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) end end ) When i join my server the labels are showing and when i press F7 they hides blabla.. It need to be reversed: When i join server they are hided when press key they shows up. Link to comment
Castillo Posted March 21, 2014 Share Posted March 21, 2014 Put that code just after you create them. Link to comment
iPrestege Posted March 21, 2014 Share Posted March 21, 2014 for i = 1,20 do guiSetVisible ( GUIEditor.label[i] ,false ) end bindKey('F7','down', function ( ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) end end ) Link to comment
Newbie Posted March 21, 2014 Author Share Posted March 21, 2014 for i = 1,20 do guiSetVisible ( GUIEditor.label[i] ,false ) end bindKey('F7','down', function ( ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) end end ) This doesn't changed anything Link to comment
Moderators Citizen Posted March 21, 2014 Moderators Share Posted March 21, 2014 This part of the code: for i = 1,20 do guiSetVisible ( GUIEditor.label[i] ,false ) end Must be placed after the gui creation as Solidsnake wanted you to do. And when it's not working, please give us the errors poping on the screen using /debugscript 3 Link to comment
Newbie Posted March 21, 2014 Author Share Posted March 21, 2014 Line: guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) Bad Argument @ guiSetVisible, at argument 1 got nil. 182 Line So my code looks like this: GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function () //MY LABELS Bla Bla end ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] ,false ) end bindKey('F7','down', function ( ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) end end ) Link to comment
DNL291 Posted March 21, 2014 Share Posted March 21, 2014 Put this inside the event "onClientResourceStart". for i = 1,20 do guiSetVisible ( GUIEditor.label[i] ,false ) end bindKey('F7','down', function ( ) for i = 1,20 do guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) end end ) Link to comment
Newbie Posted March 21, 2014 Author Share Posted March 21, 2014 Now it does not even show.. Link to comment
Karuzo Posted March 21, 2014 Share Posted March 21, 2014 Now it does not even show.. And when it's not working, please give us the errors poping on the screen using /debugscript 3 Link to comment
Newbie Posted March 21, 2014 Author Share Posted March 21, 2014 I Got it working, thanks for help anyways. 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