[UNET] Command not executing at all

I have a problem where my walking command executes but somehow not the shooting command.
Everything works fine on the host (server+client) but not when its just the client on a hosted server.

The gun script passes the variables over to the character controller script, which handles the variables and turns isShooting true. Then, what should happen is that the command code executes and turns false isShooting. However, the last bit doesn’t happen.

Everything is set up correctly, I cannot seem to find a solution to this problem. I have tried to send on the unreliable channel which didn’t fix things. Also, on client side, when I execute other commands, such as the walking sounds, they seem to lag horribly, not playing 90% of the time.

Problem Code (refer to the last 50 lines of code for the problem):

import UnityEngine.Networking;

public class charactercontroller extends NetworkBehaviour
{
var speed : float = 10;
var isWalking : boolean = false;

var gravity : float = 10;
var maxVelocityChange : float = 10;
var canJump : boolean = true;
var bhopSpeed : float = 0.25;
var jumpHeight : float = 2;
var currentvelocity : float;

var walkanimation : String;
var standanimation : String;
var crouchanimation : String;
var crouchwalkanimation : String;
var walksounds : AudioClip[];

var isCrouching : boolean = false;

private var skincolour : int;
var facemat : Material[];
var hairmat : Material[];
var skinmat : Material[];
var head : Renderer;
var face : Renderer;
var skin1 : Renderer;
var skin2 : Renderer;

var isBotControlled : boolean = false;
var isDefender : boolean = true;

var inputX : float = 0;
var inputY : float = 0;
var inputJump : boolean = false;
var inputWalk : boolean = false;
var inputCrouch : boolean = false;
var inputFire : boolean = false;
var inputReload : boolean = false;
var inputAim : boolean = false;

var isShooting : boolean = false;

private var animator : Animation;
var jumpTimer : float;
var grounded = false;
private var velocity : Vector3;
private var targetVelocity : Vector3;

private var actualdamage : float;
private var actualdamageloss : float;

private var fwd1 : Vector3;
private var firepointpos1 : Vector3;
private var firepointrot1 : Quaternion;
private var shootingpointpos1 : Vector3;
private var shootingpointrot1 : Quaternion;
private var holehit1 : GameObject;
private var holewater1 : GameObject;
private var bullet1 : GameObject;
private var muzzlevelocity1 : float;
private var gunaudio1 : GameObject;
private var smokenfire1 : GameObject; 
private var damage1 : int;
private var mindamage1 : int;
private var damageloss1 : float;

function Start () {	
	GetComponent.<Rigidbody>().freezeRotation = true;
	GetComponent.<Rigidbody>().useGravity = true;
	animator = gameObject.GetComponent.<Animation>();
	jumpTimer = 0;
	
	skincolour = Random.Range(0, facemat.length);
	print(skincolour);
	head.material = hairmat[skincolour];
	face.material = facemat[skincolour];
	skin1.material = skinmat[skincolour];
	skin2.material = skinmat[skincolour];
}

function FixedUpdate () {
	if (!isLocalPlayer) {
    return;
	}
	
	CmdAnimation();
	
	var inputModifyFactor = (inputX != 0.0 && inputY != 0.0)? .7071 : 1.0;
	
	if(!isBotControlled) { 
	inputX = Input.GetAxis("Horizontal") * inputModifyFactor; 
	inputY = Input.GetAxis("Vertical") * inputModifyFactor;
	inputJump = Input.GetButton("Jump");
	inputWalk = Input.GetButton("Walk");	
	inputCrouch = Input.GetButton("Crouch");
	inputFire = Input.GetButton("Fire1");
	inputReload = Input.GetButton("Reload");
	inputAim = Input.GetButton("Aim/SecondaryFire");
	}
	
	
	if(grounded) {
	jumpTimer += Time.deltaTime;
	
	if(jumpTimer >= bhopSpeed) { canJump = true; } 
	else if(jumpTimer <= bhopSpeed) { canJump = false; }
		
	if (canJump && inputJump) {
	GetComponent.<Rigidbody>().velocity = Vector3(GetComponent.<Rigidbody>().velocity.x, CalculateJumpVerticalSpeed(), GetComponent.<Rigidbody>().velocity.z);
	jumpTimer = 0;
		}	
	}
	
	if(!grounded) { jumpTimer = 0; }
 
	// Calculate how fast we should be moving
	targetVelocity = new Vector3(inputX, 0, inputY);
	targetVelocity = transform.TransformDirection(targetVelocity);
	targetVelocity *= speed;

	// Apply a force that attempts to reach our target velocity
	velocity = GetComponent.<Rigidbody>().velocity;
	var velocityChange = (targetVelocity - velocity);
	velocityChange.x = Mathf.Clamp(velocityChange.x, -maxVelocityChange, maxVelocityChange);
	velocityChange.z = Mathf.Clamp(velocityChange.z, -maxVelocityChange, maxVelocityChange);
	velocityChange.y = 0;
	GetComponent.<Rigidbody>().AddForce(velocityChange, ForceMode.VelocityChange);
  
	if(isWalking && !isCrouching) { speed = 4; 
	} else if(!isWalking && !isCrouching) { speed = 7; }
	
	if(isCrouching) { speed = 3; }
		
	if (!isCrouching && inputWalk) {
	isWalking = true;
	currentvelocity = currentvelocity / 2.5;
	} else if (!inputWalk) {
	isWalking = false;
	}
	
	if(inputCrouch) {
	isCrouching = true;	
	currentvelocity = currentvelocity / 3.5;
	} else if (!inputCrouch) {
	isCrouching = false;
	}
	
	var hit : RaycastHit;
	
	var layerMask = 1 << 8;
	layerMask = ~layerMask;
	
	if(Physics.Raycast(transform.position, Vector3.down, hit, 1, layerMask)) {
	Debug.DrawLine (transform.position, hit.point, Color.red);		
	grounded = true;
	} else {
	grounded = false;	
	}
	
	if(isShooting) {
	CmdShoot();
	}
}
 
function CalculateJumpVerticalSpeed ()
{
	// From the jump height and gravity we deduce the upwards speed 
	// for the character to reach at the apex.
	return Mathf.Sqrt(2 * jumpHeight * gravity);
}

//server commands n stuff, includes gun raycasts and spawning objects

function CmdAnimation () {
	if(velocity.magnitude >= 0.2) {
	currentvelocity = velocity.magnitude;
	
	if(!isCrouching) { animator.CrossFade(walkanimation, 0.1, PlayMode.StopAll); 
		} else { animator.CrossFade(crouchwalkanimation, 0.1, PlayMode.StopAll); }
	} else if(velocity.magnitude <= 0.5) {
	currentvelocity = 0;
	
	if(!isCrouching) { animator.CrossFade(standanimation, 0.1, PlayMode.StopAll); 
		} else { animator.CrossFade(crouchanimation, 0.1, PlayMode.StopAll); }
	}

	gameObject.GetComponent.<AudioSource>().volume = Mathf.Clamp(currentvelocity / 36, 0, 0.25);
	
    for (var state : AnimationState in animator) {
        state.speed = Mathf.Clamp(currentvelocity / 6, 0, 5);
    }	
}

function CmdPlayWalkSound () {
print("playing audio");
if(grounded && !isCrouching && !isWalking) { CmdSyncWalkSound(); }
}

@Command
function CmdSyncWalkSound () {
if(!NetworkServer.active) {
print("error: server not active");
return;	
}
	
print("cmd sync audio");	
RpcSyncWalkSound();
}

@ClientRpc 
function RpcSyncWalkSound () {
print("rpc sync audio");	
gameObject.GetComponent.<AudioSource>().clip = walksounds[Random.Range(0, walksounds.length - 1)];
gameObject.GetComponent.<AudioSource>().pitch = Random.Range(0.95, 1.05);
gameObject.GetComponent.<AudioSource>().Play();	
}

//gun raycasts and spawning bullets
//this part of the code looks messy, sorry

function Shoot (fwd : Vector3, firepointpos : Vector3, firepointrot : Quaternion, shootingpointpos : Vector3, shootingpointrot : Quaternion, holehit : GameObject, holewater : GameObject, bullet : GameObject, muzzlevelocity : float, gunaudio : GameObject, smokenfire : GameObject, damage : int, mindamage : int, damageloss : float) {
//simply passes the variables on to the command which cannot be called on the gun script itself >:C
fwd1 = fwd;
firepointpos1 = firepointpos;
firepointrot1 = firepointrot;
shootingpointpos1 = shootingpointpos;
shootingpointrot1 = shootingpointrot;
holehit1 = holehit;
holewater1 = holewater;
bullet1 = bullet;
muzzlevelocity1 = muzzlevelocity;
gunaudio1 = gunaudio;
smokenfire1 = smokenfire;
damage1 = damage;
mindamage1 = mindamage;
damageloss1 = damageloss;

print("server is recieving shoot call");
isShooting = true;
}	

@Command
function CmdShoot () {
//why do you not work for christs sake ;c
if(!NetworkServer.active) {
print("error: server not active");
return;	
}
	
print("server recieved and called shoot");
var hit1 : RaycastHit;
	
var gunaudioinstance = Instantiate(gunaudio1, firepointpos1, firepointrot1);
gunaudioinstance.transform.parent = transform;
NetworkServer.Spawn(gunaudioinstance);

var smoke = Instantiate(smokenfire1, firepointpos1, firepointrot1);
NetworkServer.Spawn(smoke);

if(Physics.Raycast(shootingpointpos1, fwd1, hit1, Mathf.Infinity)) {	
Debug.DrawLine (shootingpointpos1, hit1.point, Color.cyan, 10);	

var distance : float = Vector3.Distance(firepointpos1, hit1.transform.position);

actualdamageloss = Mathf.Clamp(((distance - 25) / 15) * damageloss1, 0, Mathf.Infinity);
actualdamage = Mathf.Clamp(damage1 - actualdamageloss, mindamage1, Mathf.Infinity);	
	
hit1.collider.SendMessageUpwards("TakeDamage", actualdamage, SendMessageOptions.DontRequireReceiver);

if(hit1.transform.gameObject.tag != "Water") {
var holehit2 = Instantiate(holehit1, hit1.point, Quaternion.identity);	
holehit2.transform.parent = hit1.transform.parent;
NetworkServer.Spawn(holehit2);
} else {
var holehit3 = Instantiate(holewater1, hit1.point, Quaternion.identity);	
holehit3.transform.parent = hit1.transform.parent;
NetworkServer.Spawn(holehit3);
	}
}
isShooting = false;
	}
}

Gun Script (only the line that executes the shooting code):

function CmdShootBullet () {
var fwd : Vector3 = firepoint.TransformDirection(Vector3.forward);

var currentaccuracyV : Vector3 = Vector3(Random.Range(-currentaccuracy, currentaccuracy), Random.Range(-currentaccuracy, currentaccuracy), Random.Range(-currentaccuracy, currentaccuracy));
firepoint.localEulerAngles = currentaccuracyV;

//messy chunk but it gets the job done (all clients recieve the same thing idiot)
charactercontroller.Shoot(fwd, firepoint.position, firepoint.rotation, shootingpoint.position, shootingpoint.rotation, hole, holewater, bullet, muzzlevelocity, gunaudio, smokenfire, damage, mindamage, damageloss);
}

function ProduceCasing () {
if(hasCasing) {
yield WaitForSeconds (casingdelay);

var rcasing = Instantiate(casing, casingpoint.position, casingpoint.rotation);
rcasing.GetComponent.<Rigidbody>().velocity = transform.TransformDirection(Vector3.right * Random.Range(4, 5));
	}
}

I need an answer to this really soon as I have to finish this project in the next two days.

[UPDATE]

I needed to add in sync variables for the floats and integers, but when I add them in for the GameObjects, it argues that I need to spawn them in first. However, they are prefabs, I want to spawn the prefabs in, not spawn them in first and then spawn them in again.