Photon Multiplayer Countdown TImer

Hey everyone

I’m currently trying to get a countdown timer to work correctly online. The countdown start once the first person enters the room online, but The problem is when another player enters the room the countdown for that player starts from the beginning ‘60 sec’ instead of sharing the current countdown started by the first player who entered.

I’ve tried making the countdown method a RPC allbuffed but i’m honestly not that familiar with network programming. Can anyone me out?

Thanks in advance

using UnityEngine;
using System.Collections;

public class CountDownTimer : MonoBehaviour 
{
    public float elevatorCountdown;
    public bool startElevators;

    private PhotonView myphotonView;


	void Start () 
	{
        myphotonView = gameObject.GetComponent<PhotonView>();
    }
	

	void Update () 
	{
        //StartElevatorCountdown();
        myphotonView.RPC("StartElevatorCountdown", PhotonTargets.AllBuffered);
	}

    [PunRPC]
    void StartElevatorCountdown()
    {
        this.elevatorCountdown -= Time.deltaTime;

        if (this.elevatorCountdown <= 0)
        {
            this.elevatorCountdown = 0;
            startElevators = true;
        }
    }

	void OnGUI()
	{
		if (elevatorCountdown > 0) 
		{
			GUI.Label (new Rect (100, 100, 200, 100), "Elevators will depart in " + (int)elevatorCountdown + "seconds");
		} 
	}
}

I don’t know if this is to late, but you have to call the RPC as masterclient to all clients…

void Update()
{
if (startRoundWhenTimeIsSynced)
{
this.StartRoundNow (); // the “time is known” check is done inside the method.
}

		if (PhotonNetwork.playerList.Length >= 2)
		{
			pV.RPC ("CountDown", PhotonTargets.AllBufferedViaServer);
		}
	}

	[PunRPC]
	void CountDown ()
	{
		double elapsedTime = (PhotonNetwork.time - StartTime);
		double remainingTime = SecondsPerTurn - (elapsedTime % SecondsPerTurn);
		int turn = (int)(elapsedTime / SecondsPerTurn);
		t.text = "Игра начинается через: " + remainingTime.ToString ("f0");

		if (remainingTime >= 0)
		{
			print ("WorksPerfect");
		}
	}