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 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
  #2  
Old 05-29-2009, 12:35 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
seteffect doesn't work serverside.

Try this: In your serverside function, try setting a save array member such as this.save[0] = 1.

the save variable is passed from serverside to all clients so when you set it on the server, all players will see the changes clientside.

Then just have a timeout or so check that variable to see if it has changed at all.
__________________
Do it with a DON!
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 09:05 PM.


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