How can i make gun sounds play to all players? using photon.

Hello , I am making a 3d multiplayer game using photon. I added gun and its sounds to the game and player who shoots it can hear it but not the others. How can I make it so others hear the gun sounds as well?

When one player shoots, send an RPC to Others and in the RPC play the shoot sound. On the player, if you have a script on your player that inherits from MonoBehaviourPun you can do something similar to below.
You can choose to either RPCTarget.Others or RPCTarget.All. Personally I tend to like to do something like below. That way the sound is played locally instantly

 PlayShootSound();
photonView.RPC("PlayShootSound", RPCTarget.Others);



   [PunRPC] 
    void PlayShootSoundRPC() 
    { 
        PlayShootSound();
    }

void PlayShootSound() {
aud.Play(ShootSound);
}

https://doc.photonengine.com/en-us/pun/current/gameplay/rpcsandraiseevent

https://learn.unity.com/pathway/junior-programmer