Procedural Lightning

I’m trying to make the lightning gameobject to ‘attack’ the target position, like the procedural particles here :

this is my current script nothing happends when i click play - (the lightning object doesnt attacj the target posiiton)
http://pastie.org/972311

or

using UnityEngine;
using System.Collections;

public class LightningBolt : MonoBehaviour
{
	public Transform target;
	public int zigs = 100;
	public float speed = 1f;
	public float scale = 1f;
	public Light startLight;
	public Light endLight;
	
	Perlin noise;
	float oneOverZigs;
	
	private float i = Random.Range(1,1000);

	
	public GameObject lightning;
	void Start()
	{
		oneOverZigs = 1f / (float)zigs;
	}
	
	void Update ()
	{
		if (noise == null)
			noise = new Perlin();
			
		float timex = Time.time * speed * 0.1365143f;
		float timey = Time.time * speed * 1.21688f;
		float timez = Time.time * speed * 2.5564f;
		
			Vector3 position = Vector3.Lerp(lightning.transform.position, target.position, oneOverZigs * (float)i);
			Vector3 offset = new Vector3(noise.Noise(timex + position.x, timex + position.y, timex + position.z),
										noise.Noise(timey + position.x, timey + position.y, timey + position.z),
										noise.Noise(timez + position.x, timez + position.y, timez + position.z));
			position += (offset * scale * ((float)i * oneOverZigs));
		
	}	
}

Do you get any error messages when you try to use this (such as Null Reference, etc)?

nope.

Is this the whole script you’ve posted? If so, you will need to assign the position value you calculate to an object. The example project uses particles for this and recalculates the position for each particle. The original script is actually public domain so you might be better starting with that and adapting it to whatever effect you want in your game.