Multiplayer guns firing at same time

Ok im ginna make this as quick as i can…Multiplayer game with two dufferent types of player prefab. They both have the same gun script. And its this…
sing UnityEngine.Networking;
using System.Collections;
using System;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

public class shoot : NetworkBehaviour {
public Rigidbody Bullet;
public float speed = 20f;
// Use this for initialization
void Start () {

} 

// Update is called once per frame 
void Update ()  
{ 
    if (!isLocalPlayer) 
    { 
        return; 
    } 
    if (Input.GetButtonDown ("Fire1"))  
    { 

        Rigidbody CreateObjectThing = Instantiate (Bullet, 

transform.position, transform.rotation)as Rigidbody;
CreateObjectThing.velocity =
transform.TransformDirection (new Vector3 (0, 0, speed));

    } 
} 

}

This script above ^^^^^^^^ spawns a bullet and then i put a script vvvvvv on the bullet prefab…the script is below.

using UnityEngine;
using System.Collections;

public class bulletStuff : MonoBehaviour {
public Rigidbody RigidBod;
public GUIText textwinned;

// Use this for initialization 
void Start ()  

{ }

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



} 

public void OnCollisionEnter(Collision coll) 
{ 
     


    if (coll.gameObject.tag == "BulletBreakers")  
    { 
        Destroy (RigidBod.gameObject); 
    } 
    if (coll.gameObject.tag == "PlayerSnoop")  
    { 
        GameObject.Find ("WinScreen").SetActive (true); 
        GameObject.Find ("WinImage").SetActive (true); 
        textwinned.text = ("YAY U WIN, DERP"); 
        Destroy (RigidBod.gameObject); 
    } 
    if (coll.gameObject.tag == "PlayerDerp")  
    { 
        GameObject.Find ("WinScreen").SetActive (true); 
        GameObject.Find ("WinImage").SetActive (true); 
        textwinned.text = ("YAY U WIN, SNOOP"); 
        Destroy (RigidBod.gameObject); 
    } 


} 

}

Derp is player 2 and snoop is player one. But the part that is failing is… The update function on the shoot script. The part where it says…

if (!isLocalPlayer)
{
return;
}

It works fine for my player movement script and my player turn script but not for my shoot script…WHYYYYY???

So when you fire, both characters guns fire on the client-side, but on the other instance of the game,

For example, here’s something I’d do to debug:

  1. Get another PC up and running, connect it to Ethernet (LAN) or Wireless.
  2. Put a build of the game and connect it to the session that Unity Editor is running.
  3. On player 2 (which is the PC, the host is player 1 and that’s Unity Editor) shoot your weapon. Watch the editor to see if player 2’s gun spawns a bullet or what have you. If it does, good. If the editor’s weapon also fires, you’ve got network events getting called on objects that aren’t yours.
  4. Do the same from the editor side.

Also, you should always check if the guns from other players are local or not, not bullets. Chances are you’re checking if the bullets are local and not the gun, thus when you shoot, everyone else’s guns randomly open fire.