Tete omar Posted June 16, 2012 Share Posted June 16, 2012 i see many of scripts on different of servers like when i type on edit and press enter not needed to click on a button to send my message just press enter so .. if ( source == sendmytext ) then sendmytext is a button .. so if i want also make it send a text with "enter key" should i do like that? if ( source == sendmytext or bindkey("enter_exit",down,myfunc ) then -- i know it's wrong but i just guess[ or like that if ( source == sendmytext ) then if ( source == enter_exit ) -- i know it's wrong but i just guess here's the code function furbo(state) if state == "left" then if ( source == sendmytext ) then local Player = getLocalPlayer() local thetext = guiGetText(myedit) if thetext ~= "" then triggerServerEvent("SendTexetes", getLocalPlayer(), Player, thetext) guiSetText(myedit, "") else outputChatBox("cannot send.", 255, 0, 0 ) end end end end addEventHandler("onClientGUIClick", getRootElement(), furbo) how ? and is it tall issue. Link to comment
Castillo Posted June 16, 2012 Share Posted June 16, 2012 You can use the event handler: onClientGUIAccepted which is when you press "Enter" on a GUI-edit field. Link to comment
Tete omar Posted June 16, 2012 Author Share Posted June 16, 2012 Thanks solid i own you one : )))))))))) !!!!!! 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