Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-04-2010, 05:32 AM
ChainGang_DX ChainGang_DX is offline
Animations Artist On Era
ChainGang_DX's Avatar
Join Date: Mar 2010
Location: Texas
Posts: 35
ChainGang_DX is an unknown quantity at this point
Send a message via AIM to ChainGang_DX
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");
}
}




This is the Script i'm trying to make a command that can work by hours minutes and seconds, like 00:00:00. I also Wanna make it stop counting down when I say :end, Help plz?
__________________



Scoper Zephlyn (Sat Oct 15 14:53:42 2011):
owned.
Reply With Quote
  #2  
Old 04-04-2010, 09:57 AM
ChainGang_DX ChainGang_DX is offline
Animations Artist On Era
ChainGang_DX's Avatar
Join Date: Mar 2010
Location: Texas
Posts: 35
ChainGang_DX is an unknown quantity at this point
Send a message via AIM to ChainGang_DX
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");




}
}
}

__________________



Scoper Zephlyn (Sat Oct 15 14:53:42 2011):
owned.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.