Host doesn't receive the changes clients make

I am currently working on door script, this means everyone can open the door, BUT only when the host opens the door clients see the change. When clients open the door, host and other clients don’t see the change also.

This script is attached to the player.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;

public class PlayerDoor : NetworkBehaviour
{
    private GameObject frontDoorCollider;
    private GameObject backDoorCollider;
    private GameObject sideDoorCollider;
    private Transform door;
    private Transform doorAfterRaycast;

    public float ySensitivity = 1500f;
    public float frontOpenPosLimit = 90f;
    public float backOpenPosLimit = 90;

    private float currentPos;
    private float positive = 0;
    private float negative = 0;

    bool moveDoor = false;
    DoorCollision doorCollision = DoorCollision.NONE;

    // Start is called before the first frame update
    void Start()
    {
        door = GameObject.FindWithTag("Door").transform;
        frontDoorCollider = door.Find("Front").gameObject;
        backDoorCollider = door.Find("Back").gameObject;
        sideDoorCollider = door.Find("Side").gameObject;
     
         
            
    }

    // Update is called once per frame
    void Update()
    {
        //if (!isLocalPlayer) return;
         if (Input.GetMouseButtonDown(0))
        {
            if(isServer){
                RpcMoveDoor();
            }else{
                if (hasAuthority) {
                    CmdMoveDoor();
                }
            }
          
          
        }

        if (Input.GetMouseButtonUp(0))
        {
            moveDoor = false;
        }     
    }

    void OpenDoor(){
//Debug.Log("Here");
        RaycastHit hitInfo = new RaycastHit();
        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo))
        {
            doorAfterRaycast = hitInfo.collider.transform.parent;
            Debug.Log(doorAfterRaycast);
            if (hitInfo.collider.gameObject.name == "Front" || hitInfo.collider.gameObject.name == "Side")
            {
              
                moveDoor = true;
                doorCollision = DoorCollision.FRONT;
            }
            else if (hitInfo.collider.gameObject.name == "Back")
            {
                moveDoor = true;
                doorCollision = DoorCollision.BACK;
// JUST FOR TESTING
                                                float random = Random.Range(0, 90.0f);
            doorAfterRaycast.localRotation = Quaternion.Euler(0, random, 0);
// END JUST FOR TESTING
            }
            else
            {
                doorCollision = DoorCollision.NONE;
            }
        }
        return;    
    }



    IEnumerator doorMover()
    {
        bool stoppedBefore = false;
        float yRot = 0;
      
        while (true)
        {
          
            if (moveDoor)
            {
              
                stoppedBefore = false;
                yRot += Input.GetAxis("Mouse Y") * ySensitivity * Time.deltaTime;
                if (doorCollision == DoorCollision.FRONT)
                {
                    if(negative == 0){
                        negative++;
                        positive = 0;
                      
                        yRot = -yRot;
                    }
                    yRot = Mathf.Clamp(yRot, -frontOpenPosLimit, 0);
                    //doorAfterRaycast.localRotation = Quaternion.Euler(0, -yRot, 0);
                }
                else if (doorCollision == DoorCollision.BACK)
                { 
                
                    if(positive == 0){
                        positive++;
                        negative = 0;
                        yRot = Mathf.Abs(yRot);
                    }
                  
                    yRot = Mathf.Clamp(yRot, 0, backOpenPosLimit);
                    //doorAfterRaycast.localRotation = Quaternion.Euler(0, yRot, 0);
                }
            }
            else
            {
                if (!stoppedBefore)
                {
                    stoppedBefore = true;
                }
            }

            yield return null;
        }

    }


    enum DoorCollision
    {
        NONE, FRONT, BACK
    }  

    [Command]
    public void CmdMoveDoor(){

            RpcMoveDoor();
      
    }

    [ClientRpc]
    public void RpcMoveDoor(){
      
        StartCoroutine(doorMover());
        OpenDoor();

    }  

}

These are the attributes for the door
7002530--827708--upload_2021-4-3_9-44-47.png

If more information needs to be provided I will do it without problem.

on my phone atm but this looks almost too complicated. just use a SyncVar bool open.
feed it to animator to play the animation.
players use a Cmd to ask server to open the door.

i have this script in my usurvival asset. can copy it in here later if you need it

My current script opens the door with mouse drag. Can I use SyncVar with it?

Are you getting an error on the client that the client lacks authority to call a Command on the object, whenever the client calls CmdMoveDoor? That’s what I expect to happen with a quick look at the code.

Your method for getting input from the player should have nothing to do with the networking part of this.