The more pages the closer he comes.

I’m trying to make for my slender game that every page i collect his teleport radius from player decreases. I know exactly how to make this but how do i access the pageCollect script from my slenderAI script? Here are the both scripts:

slenderAI

using UnityEngine;
using System.Collections;

public class slenderAI : MonoBehaviour {

	
public Transform player;
	
	
public bool isVisible = false;

public AudioClip Static;
	
 
void Update()
{	

//just gonna cut everything not wanted

	 if(Distance > 80 && timer == 0 && isVisible == false && pages > 1){
               Vector3 position = player.position;
               float distance = Random.Range(20.0f,35.0f);
               Vector3 objPosition = position - player.forward* distance;
               transform.position = objPosition;

}

 if(Distance > 70 && timer == 0 && isVisible == false && pages > 2){
                   Vector3 position = player.position;
                   float distance = Random.Range(18.0f,33.0f);
                   Vector3 objPosition = position - player.forward* distance;
                   transform.position = objPosition;
               transform.position = objPosition;

}
//and so on

And here is the pageCollect:

using UnityEngine;
using System.Collections;

public class PageCollect : MonoBehaviour {
	
public int pages = 0;

void Update () {


        if(pages == 3)Application.LoadLevel(0);

        RaycastHit hit;

        var fwd = transform.TransformDirection (Vector3.forward);

        

        if (Input.GetKey(KeyCode.E) || Input.GetMouseButtonDown(0)) {

            if (Physics.Raycast(transform.position, fwd, out hit, 2)) {

               if (hit.collider.tag == "Finish") {

                    Debug.Log ("Page grabbed!");
					
					pages +=1;

                    Destroy(hit.transform.gameObject);

                }

                else Debug.Log ("Not a page");


    }
 }
}

Did you try reading the manual? Assuming your scripts are attached to the same gameObject:

OtherScript otherScript = GetComponent(OtherScript);
otherScript.DoSomething(); 

If they’re on different game objects, try reading the following topic: http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

(p.s. this is probably one of the most commonly asked questions on Unity… did you try searching first?)