Graal Forums  

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

View Poll Results: Was this useful to you?
Yeah 4 40.00%
No 6 60.00%
Voters: 10. You may not vote on this poll

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-13-2006, 08:02 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Staff Tool w/ Boots

Heres a staff npc. I didn't make it, I made my friend make it as a first script or whatever soon it seemed easy I guess. =o. Anyway, free lil staff tool.

PHP Code:
// Cloyd
function onActionServerSide(action)
{
  
// Find the Appropriate Player
  
if (params[1] == "self")
    
plyr findPlayer(player.account);
  else
    
plyr findPlayer(params[1]);
    
  
// Check if player is online
  
if (plyr.level == "")
  {
    
player.chat params[1] @ " is not on!";
    return 
false;
  }
  
  
// Continue with commands if player is online
  
switch (action)
  {
    case 
"/addweapon":
    {
      
plyr.addweapon(params[2]);
      
player.chat "Weapon " params[2] @ " Added!";
      break;
    }
    
    case 
"/removeweapon":
    {
      
plyr.removeweapon(params[2]);
      
player.chat "Weapon " params[2] @ " Removed!";
      break;
    }
    
    case 
"/guild":
    {
      
plyr.guild params[2];
      
player.chat "Guild set to " params[2] @ "!";
      break;
    }
    case 
"/nick":
    {
      
plyr.nick params[2];
      
player.chat "Nickname set to " params[2] @ "!";
      break;
    }
    
    case 
"/hearts":
    {
      
plyr.hearts params[2];
      
player.chat "Hearts set to " params[2] @ "!";
      break;
    }
    
    case 
"/money":
    {
      
plyr.rupees params[2];
      
player.chat "Rupee's set to " params[2] @ "!";
      break; 
    }
     
    case 
"/ap":
    {
      
plyr.ap params[2];
      
player.chat "AP set to " params[2] @ "!";
      break;
    }
    
    case 
"/mp":
    {
      
plyr.mp params[2];
      
player.chat "MP set to " params[2] @ "!";
      break;  
    }
    
    case 
"/sword":
    {
      
plyr.swordpower params[2];
      
player.chat "Sword set to " params[2] @ "!";
      break;
    }
    
    case 
"/bombs":
    {
      
plyr.bombs params[2];
      
player.chat "Bombs set to " params[2] @ "!";
      break;
    }
    
    case 
"/arrows":
    {
      
plyr.arrows params[2];
      
player.chat "Arrows set to " params[2] @ "!";
      break;
    }
    
    case 
"/fullhearts":
    {
      
plyr.fullhearts params[2];
      
plyr.hearts plyr.fullhearts;
      
player.chat "FullHeart's set to " params[2] @ "!";
      break;
    }
    
    case 
"/shield":
    {
      
plyr.shieldpower params[2];
      
player.chat "Shield set to " params[2] @ "!";
      break;
    }
    
    case 
"/glove":
    {
      
plyr.glovepower params[2];
      
player.chat "Glove set to " params[2] @ "!";
      break;
    }
    
    case 
"/gani":
    {
      
plyr.setani(params[2], NULL); 
      
player.chat "Gani set to " params[2] @ "!";
      break;
    }
    
    case 
"/hat":
    {
      
plyr.attr[1] = params[2]; 
      
player.chat "Hat set to " params[2] @ "!";
      break;
    }
  }
}

//#CLIENTSIDE
function onCreated()
{
  
this.users = {"RedCarpet""KuJi""Frankup"}; // Add accounts here
  
if (this.users.index(player.account) <= -1)
  {
    
destroy();
  }

  
onTimeout();
}

function 
onPlayerChats()
{
  if (
player.chat.starts("/"))
  {
    
tokens player.chat.tokenize();
    
triggerserver("gui"nametokens[0], tokens[1], tokens[2], tokens[3], tokens[4]);
  }
}

function 
onKeyPressed(keycodekeychar)
{
  if (
keychar == "b")
  {
    if (!
this.bootson)
    {
      
this.bootson true;
      if (
this.bootspeed == 0this.bootspeed 1.4;
    }
      else
    {
      
this.bootson false;
    }
  }
}
function 
onTimeout()
{
  if (
this.bootson)
  {
    if (
keydown2(187false))
    {
      
this.bootspeed += 0.1;
      
player.chat "Speed: " this.bootspeed;
    }
    
    if (
keydown2(189false))
    {
      
this.bootspeed -= 0.1;
      
player.chat "Speed: " this.bootspeed;
    }
    
    if (
keydown(0))
      
player.-= this.bootspeed;
    if (
keydown(1))
      
player.-= this.bootspeed;
    if (
keydown(2))
      
player.+= this.bootspeed;
    if (
keydown(3))
      
player.+= this.bootspeed;
  }
  
  if (
middlemousebutton)
  {
    
player.mousex;
    
player.mousey;
  }
  
  
setTimer(0.05);

Reply With Quote
 


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:58 PM.


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