I'm not sure how most of you script could have worked anyway but it works like this after i fixed some things...
melon class...
NPC Code:
if (created)
{
setimg chest.png;
setshape2 1, 1, {22, 22};
}
if (actionpickup) {
setstring clientr.melon, #v(strtofloat(#s(clientr.melon))+1);
addweapon melon;
destroy;
}
melon weapon...
NPC Code:
if (actionserverside)
{
if (strequals(#p(0),melon)){
with(getplayer(#p(1))){
putnpc2 strtofloat(#v(playerx)),strtofloat(#v(playery)),{
join melon;
}
}
}
}
//#CLIENTSIDE
if (playerchats && strequals(#c,drop)){
triggeraction x, y, serverside, melon, melon, #a;
setstring clientr.melon, #v(strtofloat(#s(clientr.melon))-1);
}
pickup weapon...
NPC Code:
//#CLIENTSIDE
if (weaponfired) {
triggeraction playerx + 1.5 + vecx(playerdir)*2, playery + 2 + vecy(playerdir)*2, pickup, ;
}