Another handy thing is assigning WNPCs to vars. Let's say you got the following in -System/Inventory:
PHP Code:
//#CLIENTSIDE
function onCreated() {
inventory = this;
// more stuff..
}
public function Toggle() {
// toggle
}
Then you could do something like this in -System/InputHandler:
PHP Code:
//#CLIENTSIDE
function HandleKey(key) { // careful, I made this one up, assuming it was implemented in the WNPC earlier
if (key == "q")
inventory.Toggle();
// probably more stuff..
}