Thanks for the help again cbk1994.

I managed to get most of my Inventory done, as it is a weapon and I can use triggerserver and triggerclient without problems.
However I still can't access my player. itemfunctions from normal NPCs . Even though I copied your suggestion and only changed a few minor things, I get this error:
Quote:
|
Script: Function -ItemServerFunctions.showCategories not found at line 10 in script of npcs[13] (in level tilestest.nw at pos (32, 18))
|
I have no idea what the problem is, as the player has this weapon...
Here is the script of the NPC.
PHP Code:
//#Clientside
function onCreated()
{
this.setshape(1,32,64);
}
function onPlayerChats() {
temp.tokens = player.chat.tokenize();
if (tokens[0]=="/getcategories")
(@"-ItemServerFunctions").showCategories(this);
}
This is the script of the weapon -ItemServerFunctions
PHP Code:
function onActionServerSide() {
if(params[0]=="getCategories") {
temp.categories=player.getCategories();
triggerClient("gui", this.name, categories);
}
if(params[0]=="addItem") {
player.addItem(params[1], params[2], params[3], params[4], params[5], params[6]);
}
}
//#CLIENTSIDE
public function showCategories(npcToUpdate) {
this.npcToUpdate = npcToUpdate;
triggerServer("gui", this.name, "getCategories");
}
public function addItem(category,itemname,equippable,droppable,usable,quantity) {
triggerServer("gui", this.name, "addItem", category, itemname, equippable, droppable, usable, quantity);
}
function onActionClientSide(categories) {
this.npcToUpdate.chat="Categories: " @ categories.size() @ " first category: " @ categories[0][0];
}
Man... All these interactions between different objects and sides is so complicated.