Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-15-2008, 04:29 PM
foxpawsd foxpawsd is offline
Registered User
foxpawsd's Avatar
Join Date: Dec 2006
Posts: 14
foxpawsd is on a distinguished road
Exclamation staff block droper not working

.... it's not working can some one help?

Quote:
// Twinny's sign dropper
function onActionServerSide()
{
if (params[0] == "layblock")
{
temp.npc = putnpc2(params[1], params[2], "join(\"staffsign\");");
temp.npc.owner = player.account;
}
}

//#CLIENTSIDE
function onCreated()
setTimer(0.05);

function onKeyPressed(num1, code, num2)
{
if (code == "b")
this.block = !this.block; //Toggles on and off
}

function onTimeout()
{
if (this.block)
showimg(1, "staffblock.png", mousex, mousey);
else
hideimg(1);
setTimer(0.05);
}

function onMouseDown(mode)
{
if (mode == "left")
{
if (this.block)
triggerserver("gui", this.name, "layblock", mousex, mousey);
}
else if (mode == "double")
triggeraction(mousex, mousey, "SetMsg", player.chat);
else if (mode == "right")
triggeraction(mousex, mousey, "KillSign", "");
}
Reply With Quote
  #2  
Old 07-15-2008, 04:43 PM
Imperialistic Imperialistic is offline
graal player lord
Imperialistic's Avatar
Join Date: Apr 2007
Location: Florida
Posts: 1,094
Imperialistic is a jewel in the roughImperialistic is a jewel in the rough
can u say stol3n plx.
=P
Maybe you should talk to who actually made the script?

And do you have a class that its joining with?
__________________
" It's been swell, but the swelling's gone down. "
Reply With Quote
  #3  
Old 07-15-2008, 06:34 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I have a feeling that he is missing the "staffsign" class. Also, you shouldn't be posting scripts by other people without their permission.
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 07-15-2008, 09:18 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Make a class called staffsign and put this script in it:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
setimg("block.png");
  
setshape(13232);

That'll give you a basic idea.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #5  
Old 07-15-2008, 09:33 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Made you one, try to learn from it. Middle mouse or right click to destroy, double click to set message, b to turn on/off.


Script of weapon -Staff/Block
PHP Code:
function onActionServerSidecmddxdy )
{
  switch ( 
cmd )
  {
    case 
"dropBlock":
    {
      
temp.block putnpc2dxdy"" );
      
block.join"object_block" );
      
savelog2"staff/block.txt"format"%s layed a block at (%s, %s) in %s"player.communitynamedxdyplayer.level.name ) );
    }
  }
}
//#CLIENTSIDE
function onKeyPressedcodekey )
{
  switch ( 
key )
  {
    case 
"b":
    {
      
this.blockOn this.blockOn;
      
      if ( ! 
this.blockOn )
      {
        
hideimg);
      }
      
      
setTimerthis.blockOn .05 );
      break;
    }
  }
}
function 
onTimeOut()
{
  if ( ! 
this.blockOn )
  {
    
hideimg);
    return;
  }
  
  
showimg1"block.png"mousexmousey );
  
changeimgcolors1111.5 );
  
  if ( 
rightmousebutton )
  {
    
triggeractionmousexmousey"killBlock"player.chat );
  }
  
  if ( 
leftmousebutton )
  {
    
triggerserver"gui"name"dropBlock"mousexmousey );
    
    
hideimg);
    
setTimer.1 );
    return;
  }
  
  
setTimer0.05 );
}
function 
onMouseDownbutton )
{
  switch ( 
button )
  {
    case 
"middle":
    case 
"double":
    {
      
triggeractionmousexmousey"setMessage"player.accountplayer.chat );
      break;
    }
  }

Script of class object_block:
PHP Code:
function onCreated()
{
  
this.image "block.png";
  
setshape13232 );
}
function 
onActionSetMessageaccmsg )
{
  
savelog2"staff/block.txt"format"%s changed the message of block (%s, %s) in %s from \"%s\" to \"%s\""findPlayeracc ).communitynamethis.xthis.ythis.level.namethis.chatmsg ) );
  
this.chat msg;
}
function 
onActionKillBlockacc )
{
  
savelog2"staff/block.txt"format"%s destroyed a block at (%s, %s) in %s "findPlayeracc ).communitynamethis.xthis.ythis.level.name ) );
  
destroy();

Fully logged to logs/staff/block.txt
__________________
Reply With Quote
  #6  
Old 07-15-2008, 10:43 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
v.poor @ chris...
Reply With Quote
  #7  
Old 07-15-2008, 10:48 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Christ, what the hell is up with this?

PHP Code:
this.blockOn this.blockOn
... that's just poor.

PHP Code:
this.blockOn = !this.blockOn
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 07-15-2008, 11:23 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by xXziroXx View Post
Christ, what the hell is up with this?

PHP Code:
this.blockOn this.blockOn
... that's just poor.

PHP Code:
this.blockOn = !this.blockOn
PHP Code:
this.blockOn this.blockOn xor 1
__________________
Do it with a DON!
Reply With Quote
  #9  
Old 07-16-2008, 12:34 AM
foxpawsd foxpawsd is offline
Registered User
foxpawsd's Avatar
Join Date: Dec 2006
Posts: 14
foxpawsd is on a distinguished road
Unhappy

oh sorry this script is old and someone gave it to me but thx people no more posts plz
Reply With Quote
  #10  
Old 07-16-2008, 01:53 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
I just realized I called Chris for Christ again... -.-
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 07-16-2008, 02:40 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
Christ, what the hell is up with this?

PHP Code:
this.blockOn this.blockOn
... that's just poor.

PHP Code:
this.blockOn = !this.blockOn
I don't know ... I just prefer it.

Doesn't make a difference anyway.
__________________
Reply With Quote
  #12  
Old 07-16-2008, 09:41 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by cbk1994 View Post
I don't know ... I just prefer it.

Doesn't make a difference anyway.
It actually does

Did anyone even get my post anyways?

PHP Code:
this.blockOn this.blockOn xor 1
__________________
Do it with a DON!
Reply With Quote
  #13  
Old 07-16-2008, 12:15 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Well it has my name credited at the top of the code and,

http://forums.graalonline.com/forums...ad.php?t=71480

hey look! I released it! Guess he didn't really steal it afterall!

Anyhoo, the full script is there with the class
Reply With Quote
  #14  
Old 07-16-2008, 05:42 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Twinny View Post
Well it has my name credited at the top of the code and,

http://forums.graalonline.com/forums...ad.php?t=71480

hey look! I released it! Guess he didn't really steal it afterall!

Anyhoo, the full script is there with the class
If he got the script from that thread, I'm pretty sure he would post his question in that thread.
__________________
Do it with a DON!
Reply With Quote
  #15  
Old 07-17-2008, 03:12 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by zokemon View Post
If he got the script from that thread, I'm pretty sure he would post his question in that thread.
He said he got the script from someone else but in his post, it was credited to me + it was in the code gallery. Some of you guys were to quick to jump the 'stolen' gun.
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 02:16 PM.


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