Jump to content

Some help over here please..


Chris!i!

Recommended Posts

Posted
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!

Posted

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?

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...