on and off the rain particles for every 5 seconds

var offTime : float;

function Update(){ if(!particleEmitter.enabled && Time.time-offTime > 10){ particleEmitter.enabled = true; } }

function RendererOff(){ particleEmitter.enabled = false; offTime = Time.time; }

this code is attached to the rain GameObject which emits particle from a plane. instead of the particles rendered off, the plane works as it rendered off every 5 seconds..

can anyone help me which part did i do wrong?

I'd perhaps do that in a co-routine anyway.

var rainOn = true;

function Start()
{
 if (rainOn) dealWithRain(5);
}

function dealWithRain( timeBetweenToggle : float)
{
 while(rainOn) // So you can turn this off whenever
 {
  particleEmitter.enabled = !particleEmitter.enabled; // This is just a toggle
  yield WaitForSeconds( timeBetweenToggle);
 }

 // If it gets turned off, leave it off
 particleEmitter.enabled = false;
}

However - I can't see why you'd even want to touch the renderer? I'd personally just be turning the emitter itself on and off (keep in mind, I don't know what you need this for). In that case you would change particleEmitter.enabled to particleEmitter.emit = false/true :)