Chris!i! Posted October 8, 2016 Posted October 8, 2016 function binds() -- let's start :D text1 = guiGetText(edit[1]) text2 = guiGetText(edit[2]) text3 = guiGetText(edit[3]) text4 = guiGetText(edit[4]) text5 = guiGetText(edit[5]) text6 = guiGetText(edit[6]) text7 = guiGetText(edit[7]) text8 = guiGetText(edit[8]) if (text1 == text2) then local slot = getPedWeaponSlot(lp) if (slot == 2) then setPedWeaponSlot(lp, 3) bindKey(text2, "down", binds) elseif (slot == 3) then setPedWeaponSlot(lp, 2) bindKey(text1, "down", binds) end end end addEventHandler("onClientGUIClick", GUIEditor.button[1], binds) I'm trying to do this, so the error is with bindKey(text1, "down", binds) Since text1 will be equal to text2 the first argument of bindKey will be the same if it's text1 or text2 it's the same, but it says expect arguement at 1 nil value on debugscript 3, any helps thanks lp is defined by getLocalPlayer() and everything is working even when pressing the GUIEditor.button[1] the functions works! but bindKey isnt working which is the most important!
Chris!i! Posted October 8, 2016 Author Posted October 8, 2016 (edited) /// Edited October 8, 2016 by Chris!i!
pa3ck Posted October 8, 2016 Posted October 8, 2016 You have a check that makes sure text1 == text2 so let's say text1 = "F1" text2 = "F1" Would this make sense? bindKey("F1", "down", binds) bindKey("F1", "down", binds) Of course not, why are you trying to bind the same thing twice?
Chris!i! Posted October 8, 2016 Author Posted October 8, 2016 I tried bindKey(text1, "down", binds) outside the function and it didnt work, and tried 2 other ways and it didnt work, i would like to get some functions that could help me to do it
Dealman Posted October 8, 2016 Posted October 8, 2016 Did you by chance forget to add GUIEditor.edit[1]?
Dealman Posted October 9, 2016 Posted October 9, 2016 Could you share us a bit more of your script? Like how the edits are defined, etc.
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