Castillo Posted December 29, 2009 Share Posted December 29, 2009 hi, i made a door with a gui control with 3 buttons to open and close and i wanted to know if its posible to add a password if u know the password u can open door, if its posible can someone tell me how i should make it? thanks in advance Link to comment
Gamesnert Posted December 29, 2009 Share Posted December 29, 2009 It's possible, yes. Just do something like this server-side: password[door element here] = "password here" (or just use a non-synced setElementData, just try not to send it to the clients ) And client-side, you have an empty string. And each time a button is pressed, you add a character to the string. Then when the key is hit to send it, send the password to the server and use moveObject to move the door. Don't forget to send the door element too though, or it would be pretty useless. Probably not the best way, but as long as it's a way, it's a way. Link to comment
Castillo Posted December 29, 2009 Author Share Posted December 29, 2009 thanks, i will try Link to comment
Castillo Posted December 30, 2009 Author Share Posted December 30, 2009 i dont understand this a litle more info? Link to comment
DakiLLa Posted December 30, 2009 Share Posted December 30, 2009 uhm, as i have undestood your first post, you could make an edit field on your gui window and then, when you click on the 'open' button, you check, what's written in this edit field, if it's correct, then your door is opening, if not - then nothing.. something like this: addEventHandler( 'onClientGUIClick', button_Open, function() if guiGetText( passwordEditField ) == 'somePassword' then triggerServerEvent( 'openDoor', getLocalPlayer() ); --open your door if password is correct else outputChatBox( 'Incorrect password' ); end; end , false ); Link to comment
Castillo Posted January 4, 2010 Author Share Posted January 4, 2010 i have made the door with password 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