Please read this page for how to post code nicely on the forums: Using code tags properly
Your code:
public class HandGunDamage : MonoBehaviour
{
int DamageAmount = 5;
float TargetDistance;
float AllowedRange = 15f;
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
RaycastHit Shot;
if (Physics.Raycast(transform.position, transform.TransformDirection Vector3,forward, Shot))
{
TargetDistance = Shot.distance;
if (TargetDistance < AllowedRange)
{
Shot.transform.SendMessage("DeductPoints", DamageAmount);
}
}
}
}
}