View Single Post
  #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