Raycasting over Photon Unity Networking

hi! i am making an FPS game that uses PUN and i want to raycast a bullet but when i shoot, nothing happens to the other player i shoot at.
This is my code:
using System.Collections;
using UnityEngine;

public class SniperShoot : Photon.MonoBehaviour {

public Rigidbody rocket;
public GameObject AmmoDisplay;
public int AmmmoPerClip;
public GameObject ClipsDisplay;
public GameObject ReloadText;
public GameObject player;
public float ShootRate;
public float time;
public Rigidbody soundobj;
public int TheAmmoLeft;
public float shootdistance;
public int bulletdamage;

void FireRocket () {
	time = ShootRate;
		PhotonNetwork.Instantiate(rocket.name, transform.position, transform.rotation, 0);
		PhotonNetwork.Instantiate(soundobj.name, transform.position, transform.rotation, 0);
	AmmoDisplay.GetComponent<ShowAmmo>().ammoleft -= 1;
}
		
void Update () {
	TheAmmoLeft = AmmoDisplay.GetComponent<ShowAmmo>().ammoleft;

	time -= Time.deltaTime;
    if (Input.GetButton("Fire1")) {
   		if (time <= 0){
   			if (TheAmmoLeft >= 1){
					RaycastHit hit;
					Ray ray = new Ray (transform.position, transform.forward);

						if (Physics.Raycast (ray, out hit, shootdistance)){
						if (hit.collider.gameObject.tag == "Player"){
							hit.collider.GetComponent<Health>().PlayerHealth -= bulletdamage;
						}
					}
        		FireRocket();
        	}
    	}
    }

    if (TheAmmoLeft <= 0){
		ReloadText.SetActive (true);
		} else {
		ReloadText.SetActive (false);
		}
		if (Input.GetButtonDown("R")){
			StartCoroutine(Reload());
		}
}

	IEnumerator Reload(){
	yield return new WaitForSeconds (2);
	AmmoDisplay.GetComponent<ShowAmmo>().ammoleft = AmmmoPerClip;
	ClipsDisplay.GetComponent<ShowClips>().clipsleft -= 1;
	}
}

Please help me!!

Got to use a PunRPC