Network.Instantiate and Rigidbody.Addforce arnt working

using UnityEngine;
using System.Collections;

public class Shoot : MonoBehaviour {
	public float speed = 1000.0f;
	public Transform prefab;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(Input.GetButtonDown("Fire1"))
     	{
			Transform a = (Transform)Network.Instantiate(prefab, GameObject.Find("BulletSpawn").transform.position, Quaternion.identity , 0);
         	a.rigidbody.AddForce(transform.forward * speed);
     	}
	}
}

This isnt working and im getting this.

please help

Well first of all you cannot add a force to a object that does not exist. Which is the case of the bullet because it fail the instaniate?

And as the message states; you are not connected probably. Maybe read up on Unity network a bit.

Are you sure you aren’t trying to call GameObject.instantiate?