'TMP_Text' does not contain a definition for 'text' and no accessible extension method 'text' accep

Apparently I made a switch from Normal Text to TextMesh Pro, and I get this error all the time, as you can see from the title I did put in “using TMPro;” Here is the full script, so scroll down as far until you can see the problem…
if you can find a solution, please yell at me!

using System;
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.AI;
using TMPro;

// Token: 0x0200001F RID: 31
public class GameControllerScript : MonoBehaviour
{
    // Token: 0x06000080 RID: 128 RVA: 0x0000438C File Offset: 0x0000278C
    public GameControllerScript()
    {
        int[] array = new int[5];
        array[0] = -160;
        array[1] = -120;
        array[2] = -80;
        array[3] = -40;
        this.itemSelectOffset = array;
    }

    // Token: 0x06000081 RID: 129 RVA: 0x00004448 File Offset: 0x00002848
    private void Start()
    {
        this.audioDevice = base.GetComponent<AudioSource>(); //Get the Audio Source
        this.mode = PlayerPrefs.GetString("CurrentMode"); //Get the current mode
        this.schoolMusic.Play(); //Play the school music
        this.LockMouse(); //Prevent the mouse from moving
        this.UpdateNotebookCount(); //Update the notebook count
        this.itemSelected = 0; //Set selection to item slot 0(the first item slot)
        this.gameOverDelay = 0.5f;
        this.baldiHead.SetActive(false);
        this.headDelay = 15f;
        this.scissorsDelay = 5f;
        this.banTime = 30f;
        this.useBanButton = false;
        this.wearingShoe = false;
        this.banIndicator.SetActive(false);
        this.shoeOverlay.SetActive(false);
        this.shoeDelay = 15f;
        this.distanceIndicator.SetActive(false);
        this.distanceTime = 45f;
        this.playerCollider.enabled = true;
        this.mangHead.SetActive(false);
        this.headMangDelay = 15f;
    }

    // Token: 0x06000082 RID: 130 RVA: 0x000044BC File Offset: 0x000028BC
    private void Update()
    {
        if (!this.learningActive)
        {
            if (Input.GetButtonDown("Pause"))
            {
                if (!this.gamePaused)
                {
                    this.PauseGame();
                }
                else
                {
                    this.UnpauseGame();
                }
            }
            if (Input.GetKeyDown(KeyCode.Y) & this.gamePaused)
            {
                Time.timeScale = 1f;
                SceneManager.LoadScene("MainMenu");
            }
            else if (Input.GetKeyDown(KeyCode.N) & this.gamePaused)
            {
                this.UnpauseGame();
            }
            if (!this.gamePaused & Time.timeScale != 1f)
            {
                Time.timeScale = 1f;
            }
            if (Input.GetMouseButtonDown(1))
            {
                this.UseItem();
            }
            if (Input.GetAxis("Mouse ScrollWheel") > 0f)
            {
                this.DecreaseItemSelection();
            }
            else if (Input.GetAxis("Mouse ScrollWheel") < 0f)
            {
                this.IncreaseItemSelection();
            }
            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                this.itemSelected = 0;
                this.UpdateItemSelection();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                this.itemSelected = 1;
                this.UpdateItemSelection();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3))
            {
                this.itemSelected = 2;
                this.UpdateItemSelection();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4))
            {
                this.itemSelected = 3;
                this.UpdateItemSelection();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha5))
            {
                this.itemSelected = 4;
                this.UpdateItemSelection();
            }
        }
        else if (Time.timeScale != 0f)
        {
            Time.timeScale = 0f;
        }
        if (this.player.stamina < 0f)
        {
            this.warning.text = "REGAIN STAMINA";
        }
        else if (this.player.stamina >= 0f)
        {
            int num = Mathf.RoundToInt(this.player.stamina);
            if (this.player.stamina < (float)num)
            {
                num--;
            }
            if (num >= 1)
            {
                this.warning.text = num.ToString() + "% Stamina Left";
            }
        }
        if (this.player.gameOver)
        {
            Time.timeScale = 0f; //Pause the game
            this.gameOverDelay -= Time.unscaledDeltaTime;
            this.playerCollider.enabled = false;
            this.audioDevice.PlayOneShot(this.aud_buzz); //Play the jumpscare sound
            if (this.gameOverDelay <= 0f)
            {
                Time.timeScale = 1f; // Unpause the game
                SceneManager.LoadScene("GameOver"); // Go to the game over screen
            }
        }
        if (this.mode != "brother4" && this.finaleMode && !this.audioDevice.isPlaying && this.exitsReached == 3) //Play the weird sound after getting some exits
        {
            this.audioDevice.clip = this.aud_MachineLoop;
            this.audioDevice.loop = true;
            this.audioDevice.Play();
        }
        this.time += Time.deltaTime;
        if(this.hearAnimator.isActiveAndEnabled)
        {
            if(this.headDelay > 0f)
            {
                this.headDelay -= Time.deltaTime;
            }
        }
        if(this.headDelay <= 0f)
        {
            this.DeactivateBaldiHead();
        }
        if(this.item[this.itemSelected] == 9 && this.player.running == true)
        {
            if(this.scissorsDelay > 0f)
            {   
                this.scissorsDelay -= Time.deltaTime;
            }
            else
            {
                this.player.gameOver = true;
            }
        }
        if(this.item[this.itemSelected] == 9 && this.player.running == false)
        {
            if(this.scissorsDelay < 5f)
            {   
                this.scissorsDelay += Time.deltaTime;
            }
        }
        if(this.useBanButton == true && this.banTime > 0f)
        {
            this.banTime -= Time.deltaTime;
        }
        if(this.banTime <= 0f)
        {
            this.baldi.SetActive(true);
            this.principal.SetActive(true);
            this.banIndicator.SetActive(false);
            this.useBanButton = false;
            this.banTime = 30f;
        }
        if(this.wearingShoe == true && this.shoeDelay > 0f)
        {
            this.shoeDelay -= Time.deltaTime;
        }
        if(this.shoeDelay <= 0f)
        {
            this.shoeOverlay.SetActive(false);
            this.wearingShoe = false;
            this.shoeDelay = 15f;
        }
        if(this.exitsReached == 3)
        {
            this.baldiScript.GetAngry(0.01f);
        }
        if(this.thingUp == true)
        {
            if(this.distanceTime > 0f)
            {
                this.distanceTime -= Time.deltaTime;
            }
            else
            {
                this.distanceIndicator.SetActive(false);
                this.distanceTime = 45f;
                this.thingUp = false;
            }
            if(!this.thingScript.farAway)
            {
                if(this.distanceTime < 45f)
                {
                    this.distanceTime += Time.deltaTime;
                }
            }
        }
    }

    // Token: 0x06000083 RID: 131 RVA: 0x00004828 File Offset: 0x00002C28
    private void UpdateNotebookCount()
    {
        if (this.mode == "brother1")
        {
            this.notebookCount.text = this.notebooks.ToString() + "/7 Scripts";
        }
        else if(this.mode == "brother2")
        {
            this.notebookCount.text = this.notebooks.ToString() + "/7 Old Scripts";
        }
        else if(this.mode == "brother4")
        {
            this.notebookCount.text = this.notebooks.ToString() + "/" + this.noteCount.ToString() + " Paper";
        }
        else if(this.mode == "SPEEDY")
        {
            this.notebookCount.text = this.notebooks.ToString() + "/25 Scripts";
        }
        if (this.mode == "brother1" && this.notebooks == 7 || this.mode == "brother2" && this.notebooks == 7 || this.mode == "brother4" && this.notebooks == this.noteCount || this.mode == "SPEEDY" && this.notebooks == 25)
        {
            this.ActivateFinaleMode();
        }
    }

    // Token: 0x06000084 RID: 132 RVA: 0x000048C0 File Offset: 0x00002CC0
    public void CollectNotebook()
    {
        this.notebooks++;
        this.UpdateNotebookCount();
        this.time = 0f;
        if (this.player.stamina < 100f) //Reset Stamina
        {
            this.player.stamina = 100f;
        }
        if(this.mode == "brother4")
        {
            this.baldiScript.GetAngry(1f);
        }
    }

    // Token: 0x06000085 RID: 133 RVA: 0x000048E1 File Offset: 0x00002CE1
    public void LockMouse()
    {
        if (!this.learningActive)
        {
            this.cursorController.LockCursor(); //Prevent the cursor from moving
            this.mouseLocked = true;
            this.reticle.SetActive(true);
        }
    }

    // Token: 0x06000086 RID: 134 RVA: 0x0000490C File Offset: 0x00002D0C
    public void UnlockMouse()
    {
        this.cursorController.UnlockCursor(); //Allow the cursor to move
        this.mouseLocked = false;
        this.reticle.SetActive(false);
    }

    // Token: 0x06000087 RID: 135 RVA: 0x0000492C File Offset: 0x00002D2C
    private void PauseGame()
    {
        this.UnlockMouse();
        Time.timeScale = 0f;
        this.gamePaused = true;
        this.pauseScreen.SetActive(true);
    }

    // Token: 0x06000088 RID: 136 RVA: 0x00004963 File Offset: 0x00002D63
    private void UnpauseGame()
    {
        this.LockMouse();
        Time.timeScale = 1f;
        this.gamePaused = false;
        this.pauseScreen.SetActive(false);
    }

    // Token: 0x06000089 RID: 137 RVA: 0x0000499C File Offset: 0x00002D9C
    public void ActivateSpoopMode()
    {
        this.spoopMode = true; //Tells the game its time for spooky
        this.entrance_0.Lower(); //Lowers all the exits
        this.entrance_1.Lower();
        this.entrance_2.Lower();
        this.entrance_3.Lower();
        this.baldi.SetActive(true); //Turns on Baldi
        if(!this.challengeMode)
        {
            this.baldiTutor.SetActive(false); //Turns off Baldi(The one that you see at the start of the game)
            this.principal.SetActive(true); //Turns on Principal
            this.playtime.SetActive(true); //Turns on Playtime
            this.gottaSweep.SetActive(true); //Turns on Gotta Sweep
            this.bully.SetActive(true); //Turns on Bully
            this.firstPrize.SetActive(true); //Turns on First-Prize
            this.beans.SetActive(true); //Turns on Beans
            if(this.mode == "brother4")
            {
                this.notifierBaldi.SetActive(true); //Turns on Notifier Baldi
            }
            this.audioDevice.PlayOneShot(this.aud_Hang); //Plays the hang sound
            this.learnMusic.Stop(); //Stop all the music
            this.schoolMusic.Stop();
            if(this.mode == "brother1")
            {
                this.blastDoor1.position = new Vector3(this.xPosition, 14f, this.zPosition);
                this.blastDoor2.position = new Vector3(this.xPosition2, 14f, this.zPosition2);
            }
        }
    }

    // Token: 0x0600008A RID: 138 RVA: 0x00004A63 File Offset: 0x00002E63
    private void ActivateFinaleMode()
    {
        this.finaleMode = true;
        if(this.mode == "brother4")
        {
            this.entrance_0.Raise();
        }
        this.entrance_1.Raise();
        this.entrance_2.Raise();
        this.entrance_3.Raise();
    }

    // Token: 0x0600008B RID: 139 RVA: 0x00004A98 File Offset: 0x00002E98
    public void GetAngry(float value) //Make Baldi get angry
    {
        if (!this.spoopMode)
        {
            this.ActivateSpoopMode();
        }
        this.baldiScript.GetAngry(value);
    }

    // Token: 0x0600008C RID: 140 RVA: 0x00004AB7 File Offset: 0x00002EB7
    public void ActivateLearningGame()
    {
        this.learningActive = true;
        this.UnlockMouse(); //Unlock the mouse
        this.tutorBaldi.Stop(); //Make tutor Baldi stop talking
        if (!this.spoopMode) //If the player hasn't gotten a question wrong
        {
            this.schoolMusic.Stop(); //Start playing the learn music
            this.learnMusic.Play();
        }
    }

    // Token: 0x0600008D RID: 141 RVA: 0x00004AF4 File Offset: 0x00002EF4
    public void DeactivateLearningGame(GameObject subject)
    {
        this.learningActive = false;
        UnityEngine.Object.Destroy(subject);
        this.LockMouse(); //Prevent the mouse from moving
        if (!this.spoopMode) //If it isn't spoop mode, play the school music
        {
            this.schoolMusic.Play();
            this.learnMusic.Stop();
        }
        if (this.notebooks == 1 & !this.spoopMode) // If this is the players first notebook and they didn't get any questions wrong, reward them with a quarter
        {
            this.quarter.SetActive(true);
            this.tutorBaldi.PlayOneShot(this.aud_Prize);
        }
        else if (this.mode == "brother1" && this.notebooks == 7 || this.mode == "brother2" && this.notebooks == 7 || this.mode == "brother4" && this.notebooks == 9) // Plays the all 7 notebook sound
        {
            this.audioDevice.PlayOneShot(this.aud_AllNotebooks);
        }
    }

    // Token: 0x0600008E RID: 142 RVA: 0x00004BCC File Offset: 0x00002FCC
    private void IncreaseItemSelection()
    {
        this.itemSelected++;
        if (this.itemSelected > 4)
        {
            this.itemSelected = 0;
        }
        this.itemSelect.anchoredPosition = new Vector3((float)this.itemSelectOffset[this.itemSelected], -10f, -10f); //Moves the item selector background(the red rectangle)
        this.UpdateItemName();
    }

    // Token: 0x0600008F RID: 143 RVA: 0x00004C30 File Offset: 0x00003030
    private void DecreaseItemSelection()
    {
        this.itemSelected--;
        if (this.itemSelected < 0)
        {
            this.itemSelected = 4;
        }
        this.itemSelect.anchoredPosition = new Vector3((float)this.itemSelectOffset[this.itemSelected], -10f, -10f); //Moves the item selector background(the red rectangle)
        this.UpdateItemName();
    }

    // Token: 0x06000090 RID: 144 RVA: 0x00004C91 File Offset: 0x00003091
    private void UpdateItemSelection()
    {
        this.itemSelect.anchoredPosition = new Vector3((float)this.itemSelectOffset[this.itemSelected], -10f, 10f); //Moves the item selector background(the red rectangle)
        this.UpdateItemName();
    }

    // Token: 0x06000091 RID: 145 RVA: 0x00004CC8 File Offset: 0x000030C8
    public void CollectItem(int item_ID)
    {
        if (this.item[0] == 0)
        {
            this.item[0] = item_ID; //Set the item slot to the Item_ID provided
            this.itemSlot[0].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID
        }
        else if (this.item[1] == 0)
        {
            this.item[1] = item_ID; //Set the item slot to the Item_ID provided
            this.itemSlot[1].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID
        }
        else if (this.item[2] == 0)
        {
            this.item[2] = item_ID; //Set the item slot to the Item_ID provided
            this.itemSlot[2].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID
        }
        else if (this.item[3] == 0)
        {
            this.item[3] = item_ID; //Set the item slot to the Item_ID provided
            this.itemSlot[3].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID
        }
        else if (this.item[4] == 0)
        {
            this.item[4] = item_ID; //Set the item slot to the Item_ID provided
            this.itemSlot[4].texture = this.itemTextures[item_ID]; //Set the item slot's texture to a texture in a list of textures based on the Item_ID
        }
        else //This one overwrites the currently selected slot when your inventory is full
        {
            this.item[this.itemSelected] = item_ID;
            this.itemSlot[this.itemSelected].texture = this.itemTextures[item_ID];
        }
        this.UpdateItemName();
    }

    // Token: 0x06000991 RID: 2449 RVA: 0x000236A0 File Offset: 0x00021AA0
    private IEnumerator Teleporter()
    {
        this.playerCollider.enabled = false;
        int teleports = UnityEngine.Random.Range(7, 14);
        int teleportCount = 0;
        float baseTime = 0.3f;
        float currentTime = baseTime;
        float increaseFactor = 1.1f;
        while (teleportCount < teleports)
        {
            currentTime -= Time.deltaTime;
            if (currentTime < 0f)
            {
                this.Teleport();
                teleportCount++;
                baseTime *= increaseFactor;
                currentTime = baseTime;
            }
            this.player.height = 4f;
            yield return null;
        }
        this.playerCollider.enabled = true;
        yield break;
    }
   
    // Token: 0x06000992 RID: 2450 RVA: 0x000236BC File Offset: 0x00021ABC
    private void Teleport()
    {
        this.AILocationSelector.GetNewTarget();
        this.player.transform.position = this.AILocationSelector.transform.position + Vector3.up * this.player.height;
        this.audioDevice.PlayOneShot(this.aud_Teleport);
    }
   
    // Token: 0x06000992 RID: 2450 RVA: 0x000236BC File Offset: 0x00021ABC
    public void GiveBaldiAnApple()
    {
        this.baldiScript.AppleGiven();
    }
   
    public void GetPlayerPosition()
    {
        this.soundLocation = this.playerTransform.position;
    }
   
    // Token: 0x06000092 RID: 146 RVA: 0x00004D94 File Offset: 0x00003194
    private void UseItem()
    {
        if (this.item[this.itemSelected] != 0) //If the item slot isn't empty
        {
            if (this.item[this.itemSelected] == 1)  //Zesty Bar Code
            {
                this.player.stamina = this.player.maxStamina * 2f;
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 2) //Yellow Door Lock Code
            {
                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit;
                if (Physics.Raycast(ray, out raycastHit) && (raycastHit.collider.tag == "SwingingDoor" & Vector3.Distance(this.playerTransform.position, raycastHit.transform.position) <= 10f))
                {
                    raycastHit.collider.gameObject.GetComponent<SwingingDoorScript>().LockDoor(15f); //Lock the door for 15 seconds
                    this.ResetItem(); //Remove the item
                }
            }
            else if (this.item[this.itemSelected] == 3) //Principal's Keys Code
            {
                Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit2;
                if (Physics.Raycast(ray2, out raycastHit2) && (raycastHit2.collider.tag == "Door" & Vector3.Distance(this.playerTransform.position, raycastHit2.transform.position) <= 10f))
                {
                    raycastHit2.collider.gameObject.GetComponent<DoorScript>().UnlockDoor(); //Unlock the door
                    raycastHit2.collider.gameObject.GetComponent<DoorScript>().OpenDoor(); //Open the door
                    this.ResetItem(); //Remove the item
                }
            }
            else if (this.item[this.itemSelected] == 4) //Bsoda Code
            {
                UnityEngine.Object.Instantiate<GameObject>(this.bsodaSpray, this.playerTransform.position, this.cameraTransform.rotation); //Clone the BSODA Spray object
                bsodaSpray.GetComponent<BsodaSparyScript>().gc = this.gc; //Define the MathGameScript's GC
                this.ResetItem(); //Remove the item
                if(!this.player.inCafeteria)
                {
                    this.player.ResetGuilt("drink", 1f); // Makes the player guilty for drinking
                }
                this.audioDevice.PlayOneShot(this.aud_Soda); // Play the spray sound
            }
            else if (this.item[this.itemSelected] == 5) //Quarter Code
            {
                Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit3;
                if (Physics.Raycast(ray3, out raycastHit3))
                {
                    if (raycastHit3.collider.name == "BSODAMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f)
                    {
                        this.ResetItem(); //Remove the item
                        this.CollectItem(4); //Give BSODA
                    }
                    else if (raycastHit3.collider.name == "ZestyMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f)
                    {
                        this.ResetItem(); //Remove the item
                        this.CollectItem(1); //Give Zesty Bar
                    }
                    else if (raycastHit3.collider.name == "RandomMachine" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f)
                    {
                        this.ResetItem(); //Remove the item
                        this.CollectItem(UnityEngine.Random.Range(1, 13)); //Give Random
                    }
                    else if (raycastHit3.collider.name == "PayPhone" & Vector3.Distance(this.playerTransform.position, raycastHit3.transform.position) <= 10f)
                    {
                        raycastHit3.collider.gameObject.GetComponent<TapePlayerScript>().Play(); //Tell the phone to start making the noise
                        this.ResetItem(); //Remove the item
                    }
                }
            }
            else if (this.item[this.itemSelected] == 6) // Baldi Anti-hearing Code
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit4;
                if (Physics.Raycast(ray4, out raycastHit4) && (raycastHit4.collider.name == "TapePlayer" & Vector3.Distance(this.playerTransform.position, raycastHit4.transform.position) <= 10f))
                {
                    raycastHit4.collider.gameObject.GetComponent<TapePlayerScript>().Play(); //Tell the tape player to start making the noise
                    this.ResetItem();
                }
            }
            else if (this.item[this.itemSelected] == 7) // Alarm Clock Code
            {
                GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.alarmClock, this.playerTransform.position, this.cameraTransform.rotation); //Create a clone of the Alarm Clock
                gameObject.GetComponent<AlarmClockScript>().baldi = this.baldiScript; //Set the Alarm Clock's Baldi to the BaldiScript
                gameObject.GetComponent<AlarmClockScript>().gc = this.gc; //Define the MathGameScript's GC
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 8) // WD No Squee Code
            {
                Ray ray5 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit5;
                if (Physics.Raycast(ray5, out raycastHit5) && (raycastHit5.collider.tag == "Door" & Vector3.Distance(this.playerTransform.position, raycastHit5.transform.position) <= 10f))
                {
                    raycastHit5.collider.gameObject.GetComponent<DoorScript>().SilenceDoor(); // Silences the door
                    this.ResetItem(); //Remove the item
                    this.audioDevice.PlayOneShot(this.aud_Spray); //Plays the spray sound
                }
            }
            else if (this.item[this.itemSelected] == 9) // Safety Scissors Code
            {
                Ray ray6 = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit raycastHit6;
                if (this.player.jumpRope)
                {
                    this.player.DeactivateJumpRope();
                    this.playtimeScript.Disappoint();
                    this.ResetItem();
                }
                else if (Physics.Raycast(ray6, out raycastHit6) && raycastHit6.collider.name == "1st Prize")
                {
                    this.firstPrizeScript.GoCrazy();
                    this.ResetItem();
                }
            this.player.ResetGuilt("bully", 0.1f);
            }
            else if (this.item[this.itemSelected] == 10)  //Door Sound Code
            {
                this.GetPlayerPosition();
                if (this.baldiScript.isActiveAndEnabled)
                {
                    this.baldiScript.Hear(this.soundLocation, 10f);
                }
                this.audioDevice.PlayOneShot(this.doorOpen, 1f);
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 11) // Dangerous/Teleportation Teleporter Code
            {
                base.StartCoroutine(this.Teleporter());
                this.ResetItem();
            }
            else if (this.item[this.itemSelected] == 12)  //Ban Button Code
            {
                this.baldi.SetActive(false);
                this.principal.SetActive(false);
                this.banIndicator.SetActive(true);
                this.audioDevice.PlayOneShot(this.aud_Banned, 1f);
                this.useBanButton = true;
                if(this.banTime <= 0f)
                {
                    this.audioDevice.PlayOneShot(this.aud_Unban, 1f);
                }
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 13)  //Shoe Code
            {
                this.wearingShoe = true;
                this.shoeOverlay.SetActive(true);
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 15)  //BDD Code
            {
                this.thingUp = true;
                this.distanceIndicator.SetActive(true);
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 16) // Repel Code
            {
                GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.repeller, this.playerTransform.position, this.cameraTransform.rotation); //Create a clone of the Alarm Clock
                gameObject.GetComponent<PooMooRepellentScript>().poomoo = this.poomoo; //Set the Alarm Clock's Baldi to the BaldiScript
                this.ResetItem(); //Remove the item
            }
            else if (this.item[this.itemSelected] == 17) // Dangerous/Teleportation Teleporter Code
            {
                base.StartCoroutine(this.Teleporter());
                this.ResetItem();
            }
            else if (this.item[this.itemSelected] == 18) // Rapparep Mode Code
            {
                this.rapparepMode = true;
                this.ResetItem();
            }
            else if (this.item[this.itemSelected] == 19)  //Door Sound Code
            {
                this.GetPlayerPosition();
                if (this.priScript.isActiveAndEnabled)
                {
                    this.priScript.Hear(this.soundLocation, 10f);
                }
                this.audioDevice.PlayOneShot(this.aud_Mang, 1f);
                this.ResetItem(); //Remove the item
            }
        }
        this.usedItem = true;
    }

    // Token: 0x06000093 RID: 147 RVA: 0x000052F4 File Offset: 0x000036F4
    private void ResetItem()
    {
        this.item[this.itemSelected] = 0; //Resets the current item slot
        this.itemSlot[this.itemSelected].texture = this.itemTextures[0]; //Resets the current item slot texture
        this.UpdateItemName();
    }

    // Token: 0x06000094 RID: 148 RVA: 0x00005324 File Offset: 0x00003724
    public void LoseItem(int id)
    {
        this.item[id] = 0; //Resets the item slot
        this.itemSlot[id].texture = this.itemTextures[0]; //Resets the item slot texture
        this.UpdateItemName();
    }

    // Token: 0x06000095 RID: 149 RVA: 0x0000534A File Offset: 0x0000374A
    private void UpdateItemName()
    {
        this.itemText.text = this.itemNames[this.item[this.itemSelected]];
    }

    // Token: 0x06000096 RID: 150 RVA: 0x0000536C File Offset: 0x0000376C
    public void ExitReached()
    {
        if(!this.inF1)
        {
            this.exitsReached++;
            if (this.exitsReached == 1)
            {
                if(this.mode != "brother4")
                {
                    RenderSettings.ambientLight = Color.red; //Make everything red and start player the weird sound
                    RenderSettings.fog = true;
                    this.audioDevice.clip = this.aud_MachineQuiet;
                    this.audioDevice.loop = true;
                    this.audioDevice.Play();
                }
                this.audioDevice.PlayOneShot(this.aud_Switch, 0.8f);
            }
        }
        if(!this.inF2)
        {
            if (this.exitsReached == 2) //Play a sound
            {
                if(this.mode != "brother4")
                {
                    this.audioDevice.volume = 0.8f;
                    this.audioDevice.clip = this.aud_MachineStart;
                    this.audioDevice.loop = true;
                    this.audioDevice.Play();
                }
                else
                {
                    this.audioDevice.PlayOneShot(this.aud_Switch, 0.8f);
                }
            }
        }
        if (this.exitsReached == 3) //Play a even louder sound
        {
            if(this.mode != "brother4")
            {
                this.audioDevice.clip = this.aud_MachineRev;
                this.audioDevice.loop = false;
                this.audioDevice.Play();
                if(this.mode == "brother1" || this.mode == "brother2")
                {
                    this.entrance_0.Raise();
                }
            }
            else
            {
                this.audioDevice.PlayOneShot(this.aud_Switch, 0.8f);
                this.principal.SetActive(false); //Turns off Principal
                this.playtime.SetActive(false); //Turns off Playtime
                this.gottaSweep.SetActive(false); //Turns off Gotta Sweep
                this.bully.SetActive(false); //Turns off Bully
                this.firstPrize.SetActive(false); //Turns off First-Prize
                this.beans.SetActive(false); //Turns off Beans
                this.notifierBaldi.SetActive(false); //Turns off NB
            }
        }
    }
   
    // Token: 0x06000096 RID: 150 RVA: 0x0000536C File Offset: 0x0000376C
    public void ActivateBaldiHead()
    {
        if(!this.hearAnimator.isActiveAndEnabled)
        {   
            this.baldiHead.SetActive(true);
            if(this.headDelay <= 0f)
            {
                this.DeactivateBaldiHead();
            }
        }
        else
        {
            this.DeactivateBaldiHead();
            this.baldiHead.SetActive(true);
            if(this.headDelay <= 0f)
            {
                this.DeactivateBaldiHead();
            }
        }
    }
   
    // Token: 0x06000096 RID: 150 RVA: 0x0000536C File Offset: 0x0000376C
    public void DeactivateBaldiHead()
    {
        this.baldiHead.SetActive(false);
        this.headDelay = 15f;
    }
   
    // Token: 0x06000096 RID: 150 RVA: 0x0000536C File Offset: 0x0000376C
    public void ActivateMangHead()
    {
        if(!this.hearMangAnimator.isActiveAndEnabled)
        {   
            this.mangHead.SetActive(true);
            if(this.headMangDelay <= 0f)
            {
                this.DeactivateMangHead();
            }
        }
        else
        {
            this.DeactivateMangHead();
            this.mangHead.SetActive(true);
            if(this.headMangDelay <= 0f)
            {
                this.DeactivateMangHead();
            }
        }
    }
   
    // Token: 0x06000096 RID: 150 RVA: 0x0000536C File Offset: 0x0000376C
    public void DeactivateMangHead()
    {
        this.mangHead.SetActive(false);
        this.headMangDelay = 15f;
    }
   
    // Token: 0x04000625 RID: 1573
    public AILocationSelectorScript AILocationSelector;
   
    // Token: 0x040000AB RID: 171
    public CursorControllerScript cursorController;

    // Token: 0x040000AC RID: 172
    public PlayerScript player;

    // Token: 0x040000AD RID: 173
    public Transform playerTransform;

    // Token: 0x040000AE RID: 174
    public Transform cameraTransform;

    // Token: 0x040000AF RID: 175
    public EntranceScript entrance_0;

    // Token: 0x040000B0 RID: 176
    public EntranceScript entrance_1;

    // Token: 0x040000B1 RID: 177
    public EntranceScript entrance_2;

    // Token: 0x040000B2 RID: 178
    public EntranceScript entrance_3;

    // Token: 0x040000B3 RID: 179
    public GameObject baldiTutor;

    // Token: 0x040000B4 RID: 180
    public GameObject baldi;

    // Token: 0x040000B5 RID: 181
    public BaldiScript baldiScript;

    // Token: 0x040000B6 RID: 182
    public AudioClip aud_Prize;

    // Token: 0x040000B7 RID: 183
    public AudioClip aud_AllNotebooks;

    // Token: 0x040000B6 RID: 182
    public AudioClip aud_Banned;

    // Token: 0x040000B7 RID: 183
    public AudioClip aud_Unban;
   
    // Token: 0x040000B8 RID: 184
    public GameObject principal;
   
    public PrincipalScript priScript;

    // Token: 0x040000BA RID: 185
    public GameObject playtime;

    // Token: 0x040000BB RID: 186
    public PlaytimeScript playtimeScript;

    // Token: 0x040000BC RID: 187
    public GameObject gottaSweep;

    // Token: 0x040000BD RID: 188
    public GameObject bully;

    // Token: 0x040000BE RID: 189
    public GameObject firstPrize;

    // Token: 0x040000BF RID: 190
    public FirstPrizeScript firstPrizeScript;

    // Token: 0x040000C0 RID: 191
    public GameObject quarter;

    // Token: 0x040000C1 RID: 192
    public AudioSource tutorBaldi;

    // Token: 0x040000C2 RID: 193
    public string mode;

    // Token: 0x040000C3 RID: 194
    public int notebooks;

    // Token: 0x040000C4 RID: 195
    public GameObject[] notebookPickups;

    // Token: 0x040000C5 RID: 196
    public int failedNotebooks;

    // Token: 0x040000C6 RID: 197
    public float time;

    // Token: 0x040000C7 RID: 198
    public bool spoopMode;

    // Token: 0x040000C8 RID: 199
    public bool finaleMode;

    // Token: 0x040000C9 RID: 200
    public bool debugMode;

    // Token: 0x040000CA RID: 201
    public bool mouseLocked;

    // Token: 0x040000CB RID: 202
    public int exitsReached;

    // Token: 0x040000CC RID: 203
    public int itemSelected;

    // Token: 0x040000CD RID: 204
    public int[] item = new int[5];

    // Token: 0x040000CE RID: 205
    public RawImage[] itemSlot = new RawImage[5];

    // Token: 0x040000CF RID: 206
    public string[] itemNames = new string[]
    {
        "Hand",
        "Kitty Kat White",
        "Iron Slab",
        "Mangerie's Keys",
        "Pushy Water",
        "Dollar",
        "Brother's Least Favorite Tape",
        "Alram Clock",
        "WD-40",
        "Scissors",
        "Fake Door Sound Button",
        "Dangerous Teleporter",
        "Button to Ban Brother + Mangerie",
        "Hat Flies for the Brother",
        "The Brother Distance Indicator Thing",
        "The Poomer Repellent 2000",
        "Teleportation Teleporter",
        "Rapparep Mode",
        "Mangerie Alram Button"
    };

    // Token: 0x040000D0 RID: 207
    public TMP_Text itemText;

    // Token: 0x040000D1 RID: 208
    public UnityEngine.Object[] items = new UnityEngine.Object[20];

    // Token: 0x040000D2 RID: 209
    public Texture[] itemTextures = new Texture[20];

    // Token: 0x040000D3 RID: 210
    public GameObject bsodaSpray;

    // Token: 0x040000D4 RID: 211
    public GameObject alarmClock;

    // Token: 0x040000D5 RID: 212
    public TMP_Text notebookCount;

    // Token: 0x040000D6 RID: 213
    public GameObject pauseScreen;

    // Token: 0x040000D7 RID: 214
    public GameObject highScoreText;

    // Token: 0x040000DA RID: 217
    public TMP_Text warning;

    // Token: 0x040000DB RID: 218
    public GameObject reticle;

    // Token: 0x040000DC RID: 219
    public RectTransform itemSelect;

    // Token: 0x040000DD RID: 220
    private int[] itemSelectOffset;

    // Token: 0x040000DE RID: 222
    public bool gamePaused;

    // Token: 0x040000DF RID: 222
    private bool learningActive;

    // Token: 0x040000E0 RID: 223
    public float gameOverDelay;

    // Token: 0x040000E1 RID: 224
    private AudioSource audioDevice;

    // Token: 0x040000E2 RID: 225
    public AudioClip aud_Soda;

    // Token: 0x040000E3 RID: 226
    public AudioClip aud_Spray;

    // Token: 0x040000E4 RID: 227
    public AudioClip aud_buzz;

    // Token: 0x040000E5 RID: 228
    public AudioClip aud_Hang;

    // Token: 0x040000E6 RID: 229
    public AudioClip aud_MachineQuiet;

    // Token: 0x040000E7 RID: 230
    public AudioClip aud_MachineStart;

    // Token: 0x040000E8 RID: 231
    public AudioClip aud_MachineRev;

    // Token: 0x040000E9 RID: 232
    public AudioClip aud_MachineLoop;

    // Token: 0x040000EA RID: 233
    public AudioClip aud_Switch;

    // Token: 0x040000EB RID: 234
    public AudioSource schoolMusic;

    // Token: 0x040000EC RID: 235
    public AudioSource learnMusic;
   
    // Token: 0x040000ED RID: 236
    public GameObject baldiHead;
   
    // Token: 0x040000ED RID: 236
    public GameObject mangHead;
   
    // Token: 0x040000EE RID: 237
    public float headDelay;
   
    // Token: 0x040000EE RID: 237
    public float headMangDelay;
   
    // Token: 0x040000F1 RID: 240
    public GameObject beans;
   
    // Token: 0x040000F2 RID: 241
    public AudioClip doorOpen;
   
    // Token: 0x040000F3 RID: 242
    public Animator hearAnimator;
   
    // Token: 0x040000F3 RID: 242
    public Animator hearMangAnimator;
   
    // Token: 0x040000F4 RID: 243
    public float scissorsDelay;
   
    // Token: 0x04000633 RID: 1587
    public AudioClip aud_Teleport;
    // Token: 0x04000624 RID: 1572
    public Collider playerCollider;   
   
    // Token: 0x04000624 RID: 1572
    public GameControllerScript gc;
   
    // Token: 0x040000F4 RID: 243
    public float banTime;
   
    // Token: 0x040000DE RID: 222
    public bool useBanButton;
   
    // Token: 0x040000DB RID: 218
    public GameObject banIndicator;
   
    // Token: 0x040000DE RID: 222
    public bool wearingShoe;
   
    // Token: 0x040000F4 RID: 243
    public float shoeDelay;
   
    // Token: 0x040000DB RID: 218
    public GameObject shoeOverlay;
   
    // Token: 0x040000DB RID: 218
    public Transform blastDoor1;
   
    // Token: 0x040000DB RID: 218
    public Transform blastDoor2;
   
    // Token: 0x04000090 RID: 144
    public float xPosition;
   
    // Token: 0x04000090 RID: 144
    public float zPosition;
   
    // Token: 0x04000090 RID: 144
    public float xPosition2;
   
    // Token: 0x04000090 RID: 144
    public float zPosition2;
   
    // Token: 0x040000DE RID: 222
    public bool usedItem;
   
    // Token: 0x040000F4 RID: 243
    public float distanceTime;
   
    // Token: 0x040000F4 RID: 243
    public bool thingUp;
   
    // Token: 0x040000DB RID: 218
    public GameObject distanceIndicator;
   
    // Token: 0x040000DB RID: 218
    public BrotherDistanceThingScript thingScript;
   
    public BullyScript poomoo;
   
    public GameObject repeller;
   
    public float volume;
   
    public bool advancedMapUp;
   
    public Vector3 soundLocation;
   
    public bool challengeMode;
   
    public bool rapparepMode;
   
    public AudioClip aud_Mang;
   
    public GameObject notifierBaldi;
   
    public int noteCount;
   
    public bool inF1;
   
    public bool inF2;
   
    public bool inF3;
}

whoa. 1173 lines you you can’t be bothered to tell us which one?

Anyway, if your are using the new TMP, you are probably using the wrong type (wouldnt know, since you don’t tell me which line). But you are, for examle defining ^‘Warning’ as “TMP_Text” when it perhaps should be “TextMeshProUGUI”

Perhaps don’t use disassembled code. Write your own. Then, start small and work your way through various parts of the API.

1 Like

Ha. Ideed. That code does have a ‘generated’ feel to it, doesn’t it?

Then I came to another problem:
‘TextMeshProUGUI’ does not contain a definition for ‘text’ and no accessible extension method ‘text’ accepting a first argument of type ‘TextMeshProUGUI’ could be found (are you missing a using directive or an assembly reference?)

I recommend you heed @Suddoha ‘s advice. Working off decompile code is a bad idea. Use the original source code. If you don‘t have that, ask whoever supplied you with the decompile for it. I‘m sure they will be happy to oblige.

ummm… anybody FOCUS ON THE MAIN POINT OF THE THREAD INSTEAD OF POINTING OUT HOW THE CODE IS LIKE!

So you are working off pirated code? I‘m not sure many developers here will find that endearing. Developing original code is how we earn our keep after all.

AGAIN, I SAID KEEP IT TO THE POINT OF HOW DO I FIX THE ERROR I AM HAVING, INSTEAD OF TELLING ME HOW THE CODE LOOKS, YOU GUYS ARE NOT HELPING ME AT ALL! TIME TO CANCEL THE PROJECT WITH THIS SCRIPT IN IT ENTIRELY!

Manners, young Padawan, manners!

Sorry, that was letting my anger out for you guys not helping me at the slightest and telling me about the code’s looks and not about how to fix the error…

@csofranz already told you how to fix the issue in the first reply.