AI doesn't do damage

Hello, I was making a multiplayer fps and tried to add AI
now, my AI doesn’t do damage to the player(s)
I only get this debug error: ‘Sendmessage hp has no receiver!’
this is the code from the error: target.SendMessage( "hp", Random.Range(minDamage, maxDamage)); hp is the public variable of the player health and this is the target: var target : Transform; `
I did assigned this with NetworkingPlayer (is it to do with the change of the object name to the player name cause it’s multplayer?)

This is probably a very stupid mistake, but I can’t fix it

For SendMessage, you need a method name not variable name. You add this method to your player script

public function PlayerHealth( health: float)
         hp = health;

Then call SendMessage( “PlayerHealth”, Random.Range(minDamage, maxDamage );

how do you mean?