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.pl: allplayers){
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);
}
}
}
}