My suggestion should work. Here, I will prove it to you.
I would add the putNPC2 in a weapon of some sort.
PHP Code:
function onPlayerChats() {
if (player.chat == ":dropitem") {
with (putNPC2(player.x - 3, player.y + 1, "join item;")) { //I would change this to your class.
this.owner = player.account;
}
player.chat = "I dropped the item!";
}
}
The class for the item will look like this, only you will be able to see it.
PHP Code:
function onCreated() {
this.attr[5] = this.owner;
this.setimg("block.png");
}
function onActionGrab() {
if (player.account != this.owner) {
return; //Prevents other players from taking the item.
}
player.chat = "Item added!";
//Item adding will go here.
this.destroy();
}
//#CLIENTSIDE
function onCreated() {
if (player.account != this.attr[5]) {
this.hide();
} else {
this.show();
}
}
Hopefully this was helpful.