what's wrong with my code[NetworkBehaviour]

it’s my code.it should change scale of the characer, it works fine only on the server
what’s the problem and how can i fix it?
(it changes scale of the character on the server and the client can see it,but scale of the client changes only on the server not inside itself,i can easily add a line of code to do this but i want to know why it’s happening)

using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Networking;
    public class player : NetworkBehaviour
    {
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }
        if (Input.GetKeyDown(KeyCode.D))
        {
            CmdSetScale(1);
            RpcSetScale(1);
        }
        if (Input.GetKeyDown(KeyCode.A))
        {
            CmdSetScale(-1);
            RpcSetScale(-1);
        }  
     }
     [Command]
     public void CmdSetScale(int scale)
    {
        transform.localScale = new Vector2(scale, 1);
        Debug.Log("CmdSetScale");
    }
         [ClientRpc]
         public void RpcSetScale(int scale)
         {
             transform.localScale = new Vector2(scale, 1);
             Debug.Log("RpcSetScale");
         }

my bet would be that the transform you’re modifying is not the transform you think you’re modifying (eg. always modifying the local player, not the ‘2nd player’)