Collision script

How can I send a message to the object, that the object with this script, collided with?

var explosion : GameObject;

function OnCollisionEnter (collision : Collision) 
{
	// Instantiate explosion
    Instantiate (explosion, transform.position, transform.rotation);

	// Stop emitting particles in any children
	var emitter : ParticleEmitter= GetComponentInChildren(ParticleEmitter);
	if (emitter)
	{
		emitter.emit = false;
	}
	
	// Destroy the probe
	Destroy(gameObject);
}

Inside OnCollisionEnter function, you can use collision variable. It contains the information about the collision happened.

Refer to :http://unity3d.com/support/documentation/ScriptReference/Collision.html

You could easily locate the object collided with by collision.gameObject. Then you can call functions of that object by

collision.gameObject.GetComponent(Script_Name).do_something();