Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-12-2007, 04:57 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
My First Code in the Gallery -spar

Umkay, this is a spar script and you would place the npc in the center of ur spar

commands:
Focus = to turn on focus
Focus off = to turn off focus
Start = to start count down
/In = to enter spar
/out = to leave spar
End = to stop the count down

PHP Code:
//#CLIENTSIDE
function onPlayerChats(){
  if (
player.chat=="focus"){
    
setfocus(30.5,25);//the center of ur spar
  
}
  if (
player.chat=="focus off"){
    
resetfocus();
  }
  if(
playerx>12 && playerx<52){//first x is the top left corner of ur spar quare and the second is the botem right
    
if(playery>13 && playery<41){//same for here accept its y
      
if (player.chat=="start"){//place this npc in the middle of ur spar
        
this.chat "You have 5 seconds untill start!";
        
sleep(2);
        
this.chat "3";
        
sleep(1);
        
this.chat "2";
        
sleep(1);
        
this.chat "1";
        
sleep(1);
        
this.chat "Spar!";
        
sleep(1);
        
this.chat "Spar";
        
sleep(.1);
        
this.chat "pa";
        
sleep(.1);
        
this.chat "";
      }
      if (
player.chat=="end"){
        
this.chat "";
      }
    }
  }
  if (
player.chat=="/in"){
    
enableweapons();
    
disablepause();
    
player.30.5;//middle of ur spar
    
player.25.5;//middle of ur spar
  
}
  if (
player.chat=="/out"){
    
enablepause();
    
disableweapons();
    
player.30.5;//the out side of ur spar
    
player.46;//the out side of ur spar
  
}
  if (
player.chat=="heal"){
    
player.hearts player.fullhearts;
  }
}
function 
onPlayerDies(){
  
player.30.5;//the out side of ur spar
  
player.46;//the out side of ur spar
}
function 
onPlayerEnters(){
  
enablepause();
  
disableweapons();
}
function 
onPlayerLeaves(){
enablepause();
enableweapons();


u just have to replace the x and y coordinates
__________________
**FLIP OUT**

Last edited by theHAWKER; 06-13-2007 at 03:52 AM..
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 01:08 AM.


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