#Heshan||eUNLOCK|| Posted July 29, 2018 Share Posted July 29, 2018 I maked a Password based gate script with dx and normal gui pic This resource is working properly but i have a problem iwant to setup close butten and gui visible set to marker pls help me this is client side GUIEditor = { button = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = guiCreateButton(534, 370, 265, 54, "OPEN THE GATE", false) GUIEditor.button[2] = guiCreateButton(872, 429, 62, 37, "Close", false) GUIEditor.edit[1] = guiCreateEdit(463, 269, 250, 43, "", false) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], checkPassword ) guiEditSetMasked ( GUIEditor.edit[1], true ) end ) password = "1234" function checkPassword () local text = guiGetText ( GUIEditor.edit[1] ) if text == password then triggerServerEvent ( "openGate", resourceRoot) else outputChatBox ( "Password Incorrect!" ) end end this is the server side local gate = createObject(980,-2423.94385, -609.48846, 132.56250, 0, 0, 0) function open() moveObject(gate, 980,-2414.95703, -603.12976, 132.56250, 0, 0, 0) end addEvent( "openGate", true ) addEventHandler( "openGate", resourceRoot, open ) <meta> <meta> <info type="script" name="psswd based gate" author="heshan" version="1.0.0"></info> <script src="my2.lua" type="client" ></script> <script src="my2s.lua" type="server" ></script> </meta> pls help Link to comment
MRThinker Posted July 29, 2018 Share Posted July 29, 2018 2 hours ago, #Heshan||eUNLOCK|| said: I maked a Password based gate script with dx and normal gui pic This resource is working properly but i have a problem iwant to setup close butten and gui visible set to marker pls help me this is client side GUIEditor = { button = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = guiCreateButton(534, 370, 265, 54, "OPEN THE GATE", false) GUIEditor.button[2] = guiCreateButton(872, 429, 62, 37, "Close", false) GUIEditor.edit[1] = guiCreateEdit(463, 269, 250, 43, "", false) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], checkPassword ) guiEditSetMasked ( GUIEditor.edit[1], true ) end ) password = "1234" function checkPassword () local text = guiGetText ( GUIEditor.edit[1] ) if text == password then triggerServerEvent ( "openGate", resourceRoot) else outputChatBox ( "Password Incorrect!" ) end end this is the server side local gate = createObject(980,-2423.94385, -609.48846, 132.56250, 0, 0, 0) function open() moveObject(gate, 980,-2414.95703, -603.12976, 132.56250, 0, 0, 0) end addEvent( "openGate", true ) addEventHandler( "openGate", resourceRoot, open ) <meta> <meta> <info type="script" name="psswd based gate" author="heshan" version="1.0.0"></info> <script src="my2.lua" type="client" ></script> <script src="my2s.lua" type="server" ></script> </meta> pls help you help me with my topics and i will help you! Link to comment
#Heshan||eUNLOCK|| Posted July 29, 2018 Author Share Posted July 29, 2018 (edited) 3 hours ago, MRThinker said: you help me with my topics and i will help you! i have not better knowledge about scripting somthing i know i will help you. if you know my problem's answer pls help to improve my knowledge about lua Edited July 29, 2018 by #Heshan||eUNLOCK|| Link to comment
Manticore Posted July 31, 2018 Share Posted July 31, 2018 local password = "1234" function checkPassword () local text = guiGetText ( GUIEditor.edit[1] ) if text == password then triggerServerEvent ( "openGate", resourceRoot) outputChatBox ( "Password Correct!" ) else outputChatBox ( "Password Incorrect!" ) end end Client side. Link to comment
#Heshan||eUNLOCK|| Posted August 1, 2018 Author Share Posted August 1, 2018 13 hours ago, Mohamed Nightmare said: local password = "1234" function checkPassword () local text = guiGetText ( GUIEditor.edit[1] ) if text == password then triggerServerEvent ( "openGate", resourceRoot) outputChatBox ( "Password Correct!" ) else outputChatBox ( "Password Incorrect!" ) end end Client side. i knwo but i want to setup close butten function Link to comment
Storm-Hanma Posted August 1, 2018 Share Posted August 1, 2018 (edited) addEventHandler("onClientGUIClick",GUIEditor.button[2],replace button with your ones guiSetVisible ( GUIEditor.window[1], false ), Replace window with yours window name showCursor(false) guiSetInputEnabled(false) End For close funcrion Add the above code in your client.lua ,and replace names as I shown in code Edited August 1, 2018 by KINGKHAN 1 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