View Single Post
  #2  
Old 05-20-2010, 03:32 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
It seems to break because you're calling the weather functions every frame.
You should change the script so the emitters are defined and started only when the weather changes.
Also, calling addLocalModifier every frame is bad news and has caused major lag for me every time I've tried it.

Try something like this:
PHP Code:
function onTimeout() {
  
with (findimg(255)) {
    
player.x;
    
player.y;
    
player.z;
  }
  
  if (
this.lastWeather != serverr.weather)
  {
    
this.lastWeather serverr.weather;
    
    if (
serverr.weather == "rain") {
      
Rain();
    }
    elseif (
serverr.weather == "wind") {
      
Wind();
    }
    elseif (
serverr.weather == "fog") {
      
Fog();
    }
    elseif (
serverr.weather == "storm") {
      
Rain();
      
Lightning();
    }
    else
      
hideimgs(255256);
  }
  
  
setTimer(0.05);


Quote:
Originally Posted by sssssssssss View Post
PHP Code:
emit(); 
Also this should be emitter.emit(). And you don't need to call it unless emitautomatically is false.
Reply With Quote