Why don't my send messages work?

Well as seen in title messages are not working… they just end up causing all the send messages to activate lol…

Heres a part of the weapons script…

if (angleForward < minAngle)
{
shieldHit = “Forward”;
minAngle = angleForward;
if(shieldHit == “Forward”)
{
script.selectedTarget.;
}
else if(script.ForwardShields <= 0)
{
script.Shields = false;
}
}

       				if (angleBack < minAngle)
					{
         				shieldHit = "Back";
         				minAngle = angleBack;
						if(shieldHit == "Back")
						{
							script.selectedTarget.SendMessage("ApplyShieldDamageAft", 700);
						}
						else if(script.AftShields <= 0)
						{
							script.Shields = false;	
						}
       				}

       				if (angleRight < minAngle)
					{
         				shieldHit = "Right";
         				minAngle = angleRight;
						if(shieldHit == "Right")
						{
							//hit.transform.SendMessage("ApplyShieldDamageStarboard", 700, SendMessageOptions.DontRequireReceiver);
						}
						else if(script.StarboardShields <= 0)
						{
							script.Shields = false;	
						}
       				}

       				if (angleLeft < minAngle)
					{
         				shieldHit = "Left";
         				minAngle = angleLeft;
						if(shieldHit == "Left")
						{
							//hit.transform.SendMessage("ApplyShieldDamagePort", 700, SendMessageOptions.DontRequireReceiver);
						}
						else if(script.PortShields <= 0)
						{
							script.Shields = false;	
						}
       				}

       				if (angleTop < minAngle)
					{
         				shieldHit = "Top";
         				minAngle = angleTop;
						if(shieldHit == "Top")
						{
							//hit.transform.SendMessage("ApplyShieldDamageDorsal", 700, SendMessageOptions.DontRequireReceiver);
						}
						else if(script.DorsalShields <= 0)
						{
							script.Shields = false;	
						}
       				}

       				if (angleBot < minAngle)
					{
         				shieldHit = "Bottom";
         				minAngle = angleBot;
						if(shieldHit == "Bottom")
						{
							//hit.transform.SendMessage("ApplyShieldDamageVentral", 700, SendMessageOptions.DontRequireReceiver);
						}
						else if(script.VentralShields <= 0)
						{
							script.Shields = false;	
						}
       				}

Heres the stats script…

using UnityEngine;
using System.Collections;

public class --------------- : MonoBehaviour
{
	public string ------------ = "---------------";
	public float Shiphull = 32500;
	public float ForwardShields = 4350;//front
	public float AftShields = 4350;//back
	public float PortShields = 4350;//left
	public float StarboardShields = 4350;//right
	public float DorsalShields = 4350;//top
	public float VentralShields = 4350;//bottom
	public bool Shields = true;
	
	void ApplyShieldDamageForward(int ShieldDamageForward)
	{
        ForwardShields -= ShieldDamageForward;
    }
	
	void ApplyShieldDamageAft(int ShieldDamageAft)
	{
        AftShields -= ShieldDamageAft;
    }
	
	void ApplyShieldDamagePort(int ShieldDamagePort)
	{
        PortShields -= ShieldDamagePort;
    }
	
	void ApplyShieldDamageStarboard(int ShieldDamageStarboard)
	{
        StarboardShields -= ShieldDamageStarboard;
    }
	
	void ApplyShieldDamageDorsal(int ShieldDamageDorsal)
	{
        DorsalShields -= ShieldDamageDorsal;
    }
	
	void ApplyShieldDamageVentral(int ShieldDamageVentral)
	{
        VentralShields -= ShieldDamageVentral;
    }
	
	void ApplyDamage(int damage)
	{
        Shiphull -= damage;
    }
	
	void Update ()
	{
		if(Shiphull <= 0)
		{
			Destroy(gameObject,5);
		}
	}
}

any ideas?

You’re not using the shield hit calculation script correctly. You have to do it exactly like I showed you here.

Within the if (angle < minAngle), you don’t apply the damage yet, because there can be another angle later that is smaller. So first you run all the ifs, only after you run all the ifs can you tell which one is the minimal. After that, you can apply the damage.

Within the if, you can decide which message to send, using shieldHit = "ApplyShieldDamageAft";, etc.

Then only after you checked ALL the angles, you can actually apply damage:

script.selectedTarget.SendMessage(shieldHit);

Make all your methods public like

public void ApplyShieldDamageAft(…)