how to find other clients(players) and its attributes instantiate over Photon Network?

I(student) am a beginner at unity game development. I have Instantiate players on photon network as shown in the figure.
I cannot understand which functions/methods will be used to get the score and transform the position of other players to implement business logic for declaring the winner of the game because the same script is executed for each client.
and how I should restrict the number of clients e.g(4 players)for a certain match
this is my code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class networkManager : MonoBehaviour {
public GameObject ByCamera;
public GameObject playerScriptObj;
public string roomName;//nameEveryFriendKnows
GameObject go;
private string playerPrefabeName;
void Start () {
roomName = “friendsGroup”;
playerPrefabeName = “MalePlayer”;
void Connect() {
private void OnGUI()
{ GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());}
void OnJoinedLobby(){
RoomOptions roomOptions = new RoomOptions();
roomOptions.IsVisible = false;
roomOptions.MaxPlayers = 4;
PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
void OnJoinedRoom()
Debug.Log(“OnJinedRoom is called”);
void SpanMyPlayer()
go = (GameObject)PhotonNetwork.Instantiate(playerPrefabeName,, Quaternion.identity, 0);
ByCamera.GetComponent().enabled = true;


PUN has a score system included. You can access it by using the related extensions of the PhotonPlayer. To set a score for the local player you can use PhotonNetwork.player.SetScore(10); for example. There are also functions for adding a specific value to the score or to get it.

If you want to synchronize positions of player objects, you have to instantiate the object via PhotonNetwork.Instantiate(...);. Therefore the prefab must have an attached PhotonView component. To synchronize their position for example, the prefab also must have an attached PhotonTransformView component (or a custom solution) which has to be observed by the also attached PhotonView component. You can take a look at the Basics Tutorial or at one of the includes demos to see how this works.

How to restrict the number of clients in a room: you already have done this by setting the MaxPlayers in the Room Options when creating the room.