I'll give it a shot.
NPC Code:
if (actionBpotion){
setplayerprop #c,Dropped;
sleep 0.1;
setstring client.potions,#v(strtofloat(#s(client.potions))-1);
putnpc2 potion.gif,playerx,playery,{
if (created) {setshape 1,2,1;}
if (playetouchsme){
setstring client.potions,#v(strtofloat(#s(client.potions))+1 );
destroy;
}
};
}
//#CLIENTSIDE
if (strtofloat(#s(client.potions)) >=1) {
if (playerchats && strequals(#c,drop)) {
triggeraction x,y,Bpotion,;
//If a weapon, change x,y to 0,0
}
}
This could all be done serverside though, and you wouldn't have to worry about triggeraction.
NPC Code:
if (strtofloat(#s(client.potions)) >=1) {
if (playerchats && strequals(#c,drop)) {
drop();
}
}
function drop() {
setplayerprop #c,Dropped;
sleep 0.1;
setstring client.potions,#v(strtofloat(#s(client.potions))-1);
putnpc2 potion.gif,playerx,playery,{
if (created) {setshape 1,2,1;}
if (playetouchsme){
setstring client.potions,#v(strtofloat(#s(client.potions))+1 );
destroy;
}
};
}
Haven't tested it on a server so there is no guarantee that it will work.
I do know that putnpc2 does not work offline. Not sure about triggeraction though.