Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-29-2009, 09:43 AM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
Light Changing Script for Lightshow

I made this for my lvl but dont know whats wrong, I tried using all players and just making it clientside, but it only affects the player who said it... Can someone help me out here? Make it so that when I say /lightson I'm not the only one viewing the lightshow?
PHP Code:
function onActionlightshow(){
  
pl.seteffect(0,0,0.2,0.1);
  
sleep(0.2);
  
pl.seteffect(0,0.2,0,0.1);
  
sleep(0.2);
  
pl.seteffect(0.2,0,0,0.1);
}
//#CLIENTSIDE
function onCreated(){
  
this.on false;
}
function 
onPlayerChats(){
  if(
player.chat.starts("/play")){
    
this.playing true;
    
setTimer(0.2);
  }
  if(
player.chat.starts("/stop")){
    
this.playing false;
    
seteffect(0,0,0,0);
    
setTimer(NULL);
  }
  if(
player.chat == "/lightsoff"){
    if(
player.guild == "Tree Bar Crew"){
      
seteffect(0,0,0,0);
      
player.chat "Light effects turned off.";
      
this.on false;
    }
  }
  else if (
player.chat == "/lightson"){
    if(
player.guild == "Tree Bar Crew"){
      if(
this.playing == true){
        
player.chat "Light effects turned on.";
        
this.on true;
        
setTimer(0.2);
      }else{
        
player.chat "Light effects turned on.";
        
this.on true;
      }
    }
  }
}
function 
onTimeout(){
  if(
this.on == true){
    for(
temp.plallplayers){
      if(
pl.level == "struggler-treehideout.nw"){
        
pl.triggeraction(this.x,this.y,"lightshow",NULL);
        
pl.seteffect(0,0,0.2,0.1);
        
sleep(0.2);
        
pl.seteffect(0,0.2,0,0.1);
        
sleep(0.2);
        
pl.seteffect(0.2,0,0,0.1);
        
setTimer(0.2);
      }
    }
  }


Last edited by Struggler; 05-29-2009 at 09:51 AM.. Reason: that was kind of unnessecary.
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 09:05 PM.


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