Jump to content

Marckvdv

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Marckvdv

  1. EDIT: EVERYTHING WORKS NOW YAY! Just changed bind and unbind to bindf and unbindf like you told. Didnt know those commands worked in chat, aswell as in console. Thx for helping! --[[ I've lost my hope, i just changed it to: function bind(thePlayer, command, key, cmdToExecute, valueEntered) bindKey(thePlayer, tostring(key), "down", cmdToExecute, valueEntered) outputChatBox(key.."has been bound to do:"..cdmToExecute, thePlayer) end function unbind(thePlayer, command, key) unbindKey(thePlayer, tostring(key), "down") outputChatBox(key.."has been unbound!", thePlayer) end addCommandHandler("bindf", bind) -- <-- addCommandHandler("unbind", unbind) Binding works now, But for some reason, it doesn't print the text Also, even tough it says bindf, it works when you use bind And, I want it so that it binds a function to a key, but doesn't mess up the actual controls --]]
  2. Yes you can bind other commands to bind key. As i told, it works, the only thing I can't do is unbind the key function bindf(thePlayer, command, key, cmdToExecute, valueEntered) if(cmdToExecute == "unbind")then unbindKey(thePlayer, tostring(key), down) outputChatBox(tostring(key) "succesfully unbinded.", thePlayer) else bindKey(thePlayer, tostring(key), down, cmdToExecute, valueEntered) outputChatBox(tostring(key) + "has been binded to do:" + tostring(cmdToExecute), thePlayer) end end Forgot to add the player as argument of unbindkey, like you showed. Also:
  3. So here I made a script, which allows me to bind functions to keys. Everything works fine, but I'm not able to unbind the keys EDIT: Im not receiving anny errors, and it doesn't give me the message "key has been binded to do: command" function bind(thePlayer, command, key, cmdToExecute, valueEntered) if(cmdToExecute == "unbind")then unbindKey(tostring(key)) outputChatBox(tostring(key) "succesfully unbinded.", thePlayer) else bindKey(thePlayer, tostring(key), cmdToExecute, valueEntered) outputChatBox(tostring(key) + "has been binded to do:" + tostring(cmdToExecute), thePlayer) end end addCommandHandler("bind", bind) PS: I'm new to lua scripting, and this forum
×
×
  • Create New...