I've added a token for setting how long you want the timer to go off from. Instead of just using the Auto one by press 1.
NPC Code:
function onActionServerSide()
{
if (params[0] == "echo")
{
sendtorc("Timer Up!");
//echo("Hello World!");
}
}
//#CLIENTSIDE
function onKeyPressed(code,key)
{
if (key == "1")
{
for (i = 3; i > 0; i --)
{
player.chat = i;
sleep(1);
}
playlooped("beep2.wav");
player.chat = ":end";
//ECHO IS DONE SERVERSIDE
triggerserver("weapon",name,"echo");
sleep(5);
stopsound("beep2.wav");
play("goera3.wav");
}
}
function onPlayerChats(who,chat)
{
token = player.chat.tokenize();
if (token[0] == "/countdown" && token[1] != NULL)
{
for (i = token[1]; i > 0; i--)
{
player.chat = i;
sleep(1);
play("beep2.wav");
}
}
}