How to make network player lose health after being hit by rigidbody?

Hi, im trying to solve this for three days by now, so i ask here:

I have a multiplayer game with working authoritative moving players. Whats also working well is network instantiating fireballs done by server on players request. When a fireball collides something, it succesfully Network.destroys itself by function OnCollisionEnter and spawns my explosion prefab.

But what i need it to do is that when the fireball hits “something” tagged as Player, he has to lose 1 health.
I have tried around a hundred ways to make this happen, but not a single on was working.

Can anybody help me with this problem?

This is my working code attached to fireball that destroys the fireball itself:

function OnCollisionEnter(collision : Collision) {
// Rotate the object so that the y-axis faces along the normal of the surface
var contact : ContactPoint = collision.contacts[0];
rot = Quaternion.FromToRotation(Vector3.up, contact.normal);
pos = contact.point;

Network.Instantiate(explosionPrefab, pos, rot, 0);
Network.Destroy (gameObject);


I have tried, for example to put into this code

if(collision.gameObject.tag == "Player"){

but it worked in one from five shots, or to put into Playerscript the OnCollisionEnter and if the tag is “Fireballshot”, gave me pretty much the same result.

I also tried to try a trigger attached on the fireball and function OnTriggerEnter in the Playerscript and many other ways and im just desperate.


ok, so i moved to this:

i have separate healthscript on player:

var maxHealth:int=5;
static var curHealth:int=5;

function Awake(){
	// We are probably not the server -> only server can control this script
		enabled=false;	 // disable this script	
	}else if(Network.isServer){
		enabled=true;	 // enable this script

function OnCollisionEnter(collision:Collision){
	if(collision.gameObject.tag == "FireballShot"){
			curHealth -=1;
				transform.position = GameObject.Find("SpawnRedTeam").transform.position;
				transform.rotation = GameObject.Find("SpawnRedTeam").transform.rotation;

would work well, only problem is that when one player hits another, the the health is lost on both players and i dunno why