AI Enemy Scripting

Hi, I’m new to unity and don’t know how to script. I’m up to the stage in my game where I need to make enemies. But I only have the mesh and textures. I need it to be able to shoot and follow me, and turn into a rag-doll after 4-5 shots.
Any help would be greatly appreciated.

This is a very broad question, specially since you don’t have any scripts. You might want to start looking into tutorials.
But here is some pretty basic code in C#;
using UnityEngine;

class EnemyAI : MonoBehaviour
{

public GameObject Player;

private float ViewRange = 40;
private float RayRange = 20;
private int vel = 8;

public RaycastHit LastPos;
public Vector3 RayDirection = Vector3.zero;

public GameObject target;

public Rigidbody Bullet;
public Transform Muzzle;

public void Update()
{
    RayDirection = Player.transform.position - transform.position;

    if (Vector3.Angle(RayDirection, transform.forward) < ViewRange)
    {
        if (Physics.Raycast(transform.position, RayDirection, out LastPos, RayRange))
        {
            if (LastPos.collider.tag == "Player")
            {
                Attack();
            }
        }
    }
}

public void Attack()
{
    transform.LookAt(LastPos.transform.position);
    if (RayDirection.magnitude > 10)
    {
        transform.position = Vector3.MoveTowards(transform.position, LastPos.transform.position, Time.deltaTime * vel);
    }

    else
    {
            Rigidbody b = GameObject.Instantiate(Bullet, Muzzle.position, Muzzle.rotation) as Rigidbody;
            b.AddForce(2000 * b.transform.forward);
    }
}

private void OnCollisionEnter(Collision Hit)
{
    if (Hit.gameObject.tag == "Player")
    {
        PlayerHealth ph = (PlayerHealth)target.GetComponent("PlayerHealth");
        ph.AdjustCurrentHealth(-10);
    }
}

}

Placing that on your enemy will make him able to see and follow the player as well as shoot him. You can mess around with most of the numbered values to get your desired result. I’m sorry I didn’t really explain the code, I’m pretty tired right now so I didn’t feel like getting into all the details, if you need any more help feel free to comment on here and I’ll do my best to help you.