Newbie Posted March 21, 2014 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.
Castillo Posted March 21, 2014 Posted March 21, 2014 Put that code just after you create them. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
iPrestege Posted March 21, 2014 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 )
Newbie Posted March 21, 2014 Author 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
Moderators Citizen Posted March 21, 2014 Moderators 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 The rEvolution is coming ...
Newbie Posted March 21, 2014 Author 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 )
DNL291 Posted March 21, 2014 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 ) Please do not PM me with scripting related question nor support, use the forums instead.
Karuzo Posted March 21, 2014 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
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