Here's why it won't work (don't want you to get confused by the inexperienced others):
1. putnpc isn't used anymore, and you'll have to create a class called beer instead. Use putnpc2 like this instead:
PHP Code:
function onCreated() {
temp.npc = putnpc2(x,y,"");
temp.npc.join("class_name");
}
2. onActionLeftMouse only applies when you click an NPC. You have to use client-side events in a weapon script and send that data to the server-side then create the npc. Search the forums for triggerserver examples.
PHP Code:
//#CLIENTSIDE
function GraalControl.onMouseDown() {
player.chat = format("Clicked! X: %s Y: %s", mousex, mousey);
}
3. If you want the 'beer' to be destroyed 10 seconds after it's created you'll have to use the onCreated event and a timeout.
PHP Code:
function onCreated() {
setTimer(10); // Schedules a Timeout in 10 seconds from now.
}
function onTimeout() {
// Timeout occured
destroy();
}