Place the script file inside a Lua environment folder (such as the lua
folder or a game mode folder).
Then, include the file client-side wise as the PlayerBindPress hook is client-side only. In case of manual inclusion, make sure your implementation is included after you've included this script.
Alternatively, you can place it into lua/autorun/client
for it to be included automatically.
UnintrusiveBindPress.add(id, func, priority)
Hooks a function to the PlayerBindPress event.
- id: unique function identifier.
- func: function to run.
- priority (optional): sets a priority (1 being top priority)
UnintrusiveBindPress.remove(id)
Removes a function hooked to the PlayerBindPress event.
- id: unique function identifier.
UnintrusiveBindPress.getTable(priority)
Returns the list of functions hooked to the PlayerBindPress via this system.
- priority (optional): the priority of the functions we want to get.