How to keep objects disabled after reloading the scene?

I’ve just started kind of a first-person shooter and got the following problem:
I want to add magazines to the scene. When the Player look at them and press “E”, the object should disappear. I already got that. The problem now is, if I leave the room and enter another, then re-enter the first one, I want that the already grabbed magazines don’t appear anymore.

At the moment the script attached to the magazine-mesh looks like this:

using UnityEngine;
using System.Collections;

public class Ammo_Script : MonoBehaviour {

	bool grabbed=false;
	
	void OnStart(){
		if(grabbed){
			gameObject.SetActive(false);
		}
	}
	
	public void Grab(){
		gameObject.SetActive(false);
		grabbed=true;
		Debug.Log("grabbed ammo");
	}
}

It is accessed by this script attached to the main camera:

[...]
				if(Physics.Raycast(gameObject.transform.position,gameObject.transform.forward,out hitinfo,(float)1.5)){
					if(hitinfo.transform.name=="Gun_Ammo"){
						
						//Ammo_Script Ammo = (Ammo_Script) hitinfo.transform.gameObject.GetComponent("Ammo_Script");
						//Ammo.Grab();
						(hitinfo.collider.gameObject.GetComponent("Ammo_Script") as Ammo_Script).Grab();
						Debug.Log(hitinfo.transform.gameObject.GetInstanceID().ToString());
						Variables.gun_ammo_count++;
					}
				}
[...]

The Ammo rightly disappears, but if I re-enter the scene, it is shown again. Anyone know how to fix the script? The Ammo-Script exists multiple times.

The only way you can do that, is if you make some sort of “pickup manager” that will have DontDestroyOnLoad.

The “pickup manager” will remain between scenes and will auto hide all the picked up items.

Okay, the following script is working for me:

using UnityEngine;
using System.Collections;

public class Ammo_Script : MonoBehaviour {

	int own_level;
	
	void Awake() {
		DontDestroyOnLoad(this);
		Debug.Log("ammo-script: loaded level: "+Application.loadedLevel.ToString ()+" reloaded?: "+Variables.entered_rooms[Application.loadedLevel].ToString());
		if(Variables.entered_rooms[Application.loadedLevel]){
			Destroy(gameObject);
		}else{
			own_level=Application.loadedLevel;
		}
	}

	void OnLevelWasLoaded(int level){
		if(level==own_level){
			gameObject.collider.enabled=true;
			gameObject.renderer.enabled=true;
			gameObject.rigidbody.freezeRotation=false;
			gameObject.rigidbody.useGravity=true;
		}else{
			gameObject.collider.enabled=false;
			gameObject.renderer.enabled=false;
			gameObject.rigidbody.freezeRotation=true;
			gameObject.rigidbody.useGravity=false;
		}
	}
	
	public void Grab(){
		Destroy(gameObject);
		Debug.Log("grabbed ammo");
	}
}