Switching between two weapons

Hi guys i am currently using two scripts to choose my weapon before I spawn my player into the game and use two models.(knife and gun)But when i choose my gun, my (knife model) spawns too.Same the other way too.I have no idea why this happens.Here’s my script.

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

public class WeaponManager : MonoBehaviour {
	public List<Gun> Weapons = new List<Gun>();
	public int CurWeapon;
	public static WeaponManager Instance;
	// Use this for initialization
	void Start () {
		Instance = this;
	
	}
	
	// Update is called once per frame
	void Update () {
		CurWeapon = GUIManager.Instance.CurWeapon;

	}

	public void Spawn()
	{
		CurWeapon = GUIManager.Instance.CurWeapon;
		transform.root.GetComponent<Character> ().Server_GetGun (Weapons [CurWeapon].Name);
		ApplyWeapon();


	}

	public void ApplyWeapon()
	{
		foreach (Gun gu in Weapons)
		{
			if(gu == Weapons[CurWeapon])
			{
				gu.gameObject.SetActive(true);
			}
			else
			{
				gu.gameObject.SetActive(false);
			}
		}
	}

	public static Gun FindWeapon(string Name)
	{
		foreach (Gun Gu in Instance.Weapons)
		{
			if(Name == Gu.Name)
				return Gu;
		}
		return null;
	}
}

The other one:(near Client_GetGun)

	[RPC]
	public void Client_GetGun(string name)
	{
		foreach (ThirdPersonGuns tpg in Guns) 
		{
			if(tpg.Name == name)
			{
				tpg.Obj.SetActive(true);
				Debug.Log (tpg + "Done");
			}
			else
			{
				tpg.Obj.SetActive (false);
				Debug.Log (tpg + "Not Done");
		}
	}
}

[System.Serializable]
public class ThirdPersonGuns
{
	public string Name;
	public GameObject Obj;
}
}

I don’t see anything immediately wrong with the code above, but you could approach this a slightly more efficient way (and who knows, it might fix it). Instead of looping through all weapons and turning 1 on and the rest off (I assume that’s what you’re doing). Just track the current weapon and previous weapon. Then when you set the current weapon, turn the previous weapon off if it is not null. Then set the previous to the current for next time.

If that still doesn’t work, how is your game object setup? Do you have a single prefab object, or a parent object with children, and is that parent (the prefab root) object the one that contains your Gun script? If the Gun script is on a child of the prefab parent, then you are only setting the gameObject to inactive for that child object (the one the Gun script is on), and presumably the renderer is on a different gameObject in the hierarchy.