Boolean resetting itself?

Hi, I’m trying to set a Bool to change with a toggle button, but for some reason it is not staying as what it toggles to. When running the script the debug window will constantly keep printing the Bool is False string and Upon pressing the toggle button the debug log will print one line of Bool is true then go back to returning Bool is false. Here is relevant part of the script

    // Layout the GUI
    	void OnGUI () {
    
    		GUI.skin = guiSkin;
    		
    		GUILayout.BeginVertical();
    		GUILayout.Window (0, new Rect(settings.xPos, settings.yPos, settings.width, genderWindowSettings.height), GenderWindowContents, "Choose Gender", windowStyle);
    		
        void LegsWindowContents (int windowID) {
        		scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (settings.width - 10.0f), GUILayout.Height (attributeWindowSettings.height - 70.0f));
        		GUILayout.BeginVertical(verticalLayoutStyle);
    
        // Male Kneepads
        
        		if (selectedGender == "male" && maleKneepads.Count > 1) {
    
                    GUILayout.BeginHorizontal ();
    
                    Bool showMaleKneepadsElemants = False; 
        
        			showMaleKneepadsElements= GUILayout.Toggle (showMaleKneepadsElements, "Kneepads", tabStyle);
        			GUILayout.EndHorizontal ();
        
        			if (showMaleKneepadsElements) {print("Bool is True");}
        			else  {print ("Bool is False");}
}
}

If I am doing some schoolboy error then I apologise, it’s been a while since I last wrote any code and I wasn’t particularly good at it then, ha! (plus I used Basic, not C#) This is actually an edit of someone else’s code, too, I’ve tried messaging him personally but haven’t got a reply.

Line 19 needs to be global. Declare the bool globally and set it to false on start, instead of setting it to false everytime OnGUI runs