Script not disabling

Hello,

So I have code which is supposed to switch to first person camera views, turn on several scripts and turn off the NavMeshAgent and script I used to run AI. What seems to be hanging me up is the ai_script refuses to turn off which results in all sorts of issues, everything else seems to work… The relevant bit of code is:

posted below using the lovely “code sample” button which is the 101010 button…

You need more than GetComponent() to get a component. GetComponent requires the type. Check out the docs.

Is there some kind of catch-22 issue turning the NavMeshAgent off?

If I put the turn off script before turning the NavMeshAgent off I get an error at runtime when I click the button that says, “NullReferenceException: Object reference not set to an instance of an object
god_mode.OnGUI () (at Assets/god_mode.cs:55)”

However, if I switch the order. I get a 30 fps of ““SetDestination” can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.NavMeshAgent:SetDestination(Vector3)
heathen_ai:Update() (at Assets/heathen_ai.cs:27)”

Keep in mind this is all run time stuff after I click the button. I get no errors before run time.

So this is really weird, I changed my code to this:
ai_script.GetComponent<heathen_ai>().enabled = false;
heathen_leader.GetComponent().enabled = false;

And I get the “NullReferenceException: Object reference not set to an instance of an object
god_mode.OnGUI () (at Assets/god_mode.cs:55)” on the script, but not on the NavMeshAgent…and now neither of them turn off…I used to be able to get the NavMeshAgent to to turn off…