am having problems with a level select map manager c# script

so this is the script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LevelSelectManager : MonoBehaviour {

    public string[] levelTags;

    public GameObject[] locks = new GameObject[1];
    public bool levelUnlocked;

    // Use this for initialization
    void Start () {

        for(int i =0; i < levelTags.Length; i++)
            {
            
            if (PlayerPrefs.GetInt (levelTags [i]) == null)
            {
                levelUnlocked [i] = false;
            } else if (PlayerPrefs.GetInt (levelTags [i]) == 0)
            {
                levelUnlocked [i] = false;
            } else {
                levelUnlocked [i] = true;
            }

            if (levelUnlocked [i])
            {
                locks[i].SetActive (false);
            }
                
        }
    

    }
 
    // Update is called once per frame
    void Update () {
    
    }
}

the problems am having are:
1: (18,20): warning CS0472: The result of comparing value type int' with null is always false’
2: (20,19): error CS0021: Cannot apply indexing with [ ] to an expression of type bool' 3: (23,19): error CS0021: Cannot apply indexing with [ ] to an expression of type bool’
4: (25,19): error CS0021: Cannot apply indexing with [ ] to an expression of type bool' 5: (28,22): error CS0021: Cannot apply indexing with [ ] to an expression of type bool’

The compiler’s right in all cases.

So why are you doing those things, and what do you mean to do instead?

Take the first one, for example: on line 18, you’re getting an int from PlayerPrefs, and checking whether it’s null. Well, it isn’t. Ints are never null (as the compiler warning points out). So why are you doing this?

Then, on lines 20, 23, 25, and 28, you’re trying to index into a boolean. You can’t do that; booleans don’t store multiple values. What is it you mean to do instead? Should levelUnlocked be a bool array, rather than a simple bool? Or perhaps you don’t really need a bool property at all; maybe you just need a simple local variable, which you assign to (without trying to index) and then check (again without an index) on line 28?

We can’t tell you what you intend here… and the compiler errors are already telling you what’s wrong with what you’ve written. I really don’t have too much to add (but I hope this helped a little anyway!).

ok that’s helped thanks
but what i was trying to do was make a simple lock system
so when you are playing the game and reach a new level it get’s unlocked in the level select and when i press new game it delete’s playerprefs so the locks get reset