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)) {
x = player.x;
y = player.y;
z = 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(255, 256);
}
setTimer(0.05);
}
Quote:
Originally Posted by sssssssssss
|
Also this should be emitter.emit(). And you don't need to call it unless emitautomatically is false.