Button locking/unlocking for loop using an object array & playerprefs

So I have an array of buttons, this script at the start function uses a for loop defines player pref integers for the buttons in the array, 1 being intaractable and 0 being locked. button0 should be interactable and 1-14 should be locked, the problem is it’s not. And again at the update function uses a for loop toggles interactable depending on if the button has a 1 or 0.

Here’s the code:

void start () {

for (int i = 0; i < buttons.Length; i++) {

			if (PlayerPrefs.GetInt("button" + 0) == null) {

				PlayerPrefs.SetInt("button" + 0, 1);

			}

			if (PlayerPrefs.GetInt("button" + i) == null) {

				PlayerPrefs.SetInt("button" + i, 0);

			}

		}

}

The indenting’s weird here.

void Update () {

		for (int i = 0; i < buttons.Length; i++) {

			if (PlayerPrefs.GetInt("button" + i) == 0) {

				buttons*.interactable = false;*
  •  	} else if (PlayerPrefs.GetInt("button" + i) == 1) {*
    

_ buttons*.interactable = true;*_

* }*

* }*

* }*
-Please help

It was answered by some1 else, tyvm :slight_smile: