rpc doesnt get called on client

I want to make an automated level generator for my multiplayer lan game and that’s works al fine. But when I also want to build the level on the clients the RPC function only get called on the server. I have tried a lot of things but I don’t know what I do wrong.
So the problem is the PRC only gets called on the server and not on the clients.
(and I know that Unet will be outdated but know a little bit how to use it and don’t want to learn another networking solution)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class LevelGeneration : NetworkBehaviour
{
    public GameObject plank;
    public GameObject building;
    public GameObject buildingBackground;

    private GameObject start;
    private GameObject end;

    [SyncVar]
    public Vector2 range;
    private Vector3 spawnPos;

    private float lastYPos;

    [SyncVar]
    private float randomPosY;

    [SyncVar]
    private float randomValueChooseHouse;

    [SyncVar]
    private float randomValueChooseBackgroundHouse;

    private bool tikTak;

    // Start is called before the first frame update
    void Start()
    {
        start = GameObject.FindGameObjectWithTag("Start");
        end = GameObject.FindGameObjectWithTag("End");

        if(isServer)
        {
            BuildMap();
        }
    }

    [ClientRpc]
    public void RpcPlaceBuildingOnClient(int i)
    {
        if (isServer)
        {
            return;
        }
        GameObject buildingObj = Instantiate(building, transform);
        buildingObj.transform.position = spawnPos;

        if (i == 0)
        {
            buildingObj.transform.position = new Vector3(buildingObj.transform.position.x, spawnPos.y - 2, buildingObj.transform.position.z);
        }
        else
        if (i == 9)
        {
            end.transform.position = buildingObj.transform.position;
        }
    }

    [ClientRpc]
    public void RpcPlacePlankOnClient(int i)
    {
        if (isServer)
        {
            return;
        }
        GameObject plankObj = Instantiate(plank, transform);
        plankObj.transform.position = spawnPos;

        if (i == 0)
        {
            plankObj.transform.position = new Vector3(plankObj.transform.position.x, spawnPos.y - 2, plankObj.transform.position.z);
        }
        else
        if (i == 9)
        {
            end.transform.position = plankObj.transform.position;
        }
    }

    public void BuildMap()
    {
        spawnPos = start.transform.position;
        for (int i = 0; i < 10; i++)
        {
            randomValueChooseHouse = Random.value;

            if (randomValueChooseHouse >= 0.7)
            {
                //spawn Building and set on good location
                GameObject buildingObj = Instantiate(building, transform);
                buildingObj.transform.position = spawnPos;
                RpcPlaceBuildingOnClient(i);
                //doe iets als dit de eerste plank is en doe iets als dit laaste plank is
                if (i == 0)
                {
                    buildingObj.transform.position = new Vector3(buildingObj.transform.position.x, spawnPos.y - 2, buildingObj.transform.position.z);
                    if (isServer)
                    {
                        randomPosY = randomPosY - 2;
                    }
                }
                else
                if (i == 9)
                {
                    end.transform.position = buildingObj.transform.position;
                }
            }
            else
            {
                if (isServer)
                {
                    randomValueChooseBackgroundHouse = Random.value;
                }

                //spawn plank and set on good location
                GameObject plankObj = Instantiate(plank, transform);
                plankObj.transform.position = spawnPos;
                RpcPlacePlankOnClient(i);
                //doe iets als dit de eerste plank is en doe iets als dit laaste plank is
                if (i == 0)
                {
                    plankObj.transform.position = new Vector3(plankObj.transform.position.x, spawnPos.y - 2, plankObj.transform.position.z);
                    if (isServer)
                    {
                        randomPosY = randomPosY - 2;
                    }
                }
                else
                if (i == 9)
                {
                    end.transform.position = plankObj.transform.position;
                }

                if (randomValueChooseBackgroundHouse > 0.5)
                {
                    GameObject buildBackgroundObj = Instantiate(buildingBackground, transform);
                    if (tikTak)
                    {
                        buildBackgroundObj.transform.position = new Vector3(plankObj.transform.position.x + Random.Range(-6, 6), plankObj.transform.position.y + Random.Range(2, 15), plankObj.transform.position.z + 100);
                        tikTak = false;
                    }
                    else
                    {
                        buildBackgroundObj.transform.position = new Vector3(plankObj.transform.position.x + Random.Range(-6, 6), plankObj.transform.position.y + Random.Range(2, 15), plankObj.transform.position.z);
                        tikTak = true;
                    }
                }
            }

            //zet spawn pos op een bepaalde plek
            lastYPos = randomPosY;

            if (isServer)
            {
                randomPosY = Random.Range(range.x, range.y);

                while (Mathf.Abs(lastYPos - randomPosY) > 2 && randomPosY >= lastYPos)
                {
                    Debug.Log("hoi");
                    randomPosY = Random.Range(range.x, range.y);
                }

            }

            spawnPos = new Vector3(spawnPos.x + 25, randomPosY, spawnPos.z);
            
        }
    }

}

I fixed it

the problem was that is started it before unet was done doing its thing.
now I have fixed it and removed some bugs.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class LevelGeneration : NetworkBehaviour
{
    public GameObject plank;
    public GameObject building;
    public GameObject buildingBackground;

    private GameObject start;
    private GameObject end;

    [SyncVar]
    public Vector2 range;
    private Vector3 spawnPos;

    private float lastYPos;

    [SyncVar]
    private float randomPosY;

    [SyncVar]
    private float randomValueChooseHouse;

    [SyncVar]
    private float randomValueChooseBackgroundHouse;

    private bool tikTak;
    private bool firstUpdate;

    // Start is called before the first frame update
    void Start()
    {
        start = GameObject.FindGameObjectWithTag("Start");
        end = GameObject.FindGameObjectWithTag("End");
        
    }

    private void Update()
    {
        if (isServer && firstUpdate == false)
        {
            BuildMap();
            firstUpdate = true;
        }
    }

    [ClientRpc]
    public void RpcPlaceBuildingOnClient(int i, Vector3 spawnPosClient)
    {
        if (isServer)
        {
            return;
        }
        GameObject buildingObj = Instantiate(building, transform);
        buildingObj.transform.position = spawnPosClient;

        if (i == 0)
        {
            buildingObj.transform.position = new Vector3(buildingObj.transform.position.x, spawnPosClient.y - 2, buildingObj.transform.position.z);
        }
        else
        if (i == 9)
        {
            end.transform.position = buildingObj.transform.position;
        }
    }

    [ClientRpc]
    public void RpcPlacePlankOnClient(int i, Vector3 spawnPosClient)
    {
        if (isServer)
        {
            return;
        }
        GameObject plankObj = Instantiate(plank, transform);
        plankObj.transform.position = spawnPosClient;

        if (i == 0)
        {
            plankObj.transform.position = new Vector3(plankObj.transform.position.x, spawnPosClient.y - 2, plankObj.transform.position.z);
        }
        else
        if (i == 9)
        {
            end.transform.position = plankObj.transform.position;
        }
    }

    [ClientRpc]
    public void RpcPlaceBackgroundBuildingClient(Vector3 spawnPosClient, float random1, float random2, bool tikTakClient)
    {
        if (isServer)
        {
            return;
        }

        GameObject buildBackgroundObj = Instantiate(buildingBackground, transform);
        if (tikTakClient)
        {
            buildBackgroundObj.transform.position = new Vector3(spawnPosClient.x + random1, spawnPosClient.y + random2, spawnPosClient.z + 100);
            tikTakClient = false;
        }
        else
        {
            buildBackgroundObj.transform.position = new Vector3(spawnPosClient.x + random1, spawnPosClient.y + random2, spawnPosClient.z);
            tikTakClient = true;
        }
    }

    public void BuildMap()
    {
        spawnPos = start.transform.position;
        for (int i = 0; i < 10; i++)
        {
            randomValueChooseHouse = Random.value;

            if (randomValueChooseHouse >= 0.7)
            {
                //spawn Building and set on good location
                GameObject buildingObj = Instantiate(building, transform);
                buildingObj.transform.position = spawnPos;
                RpcPlaceBuildingOnClient(i, spawnPos);
                //doe iets als dit de eerste plank is en doe iets als dit laaste plank is
                if (i == 0)
                {
                    buildingObj.transform.position = new Vector3(buildingObj.transform.position.x, spawnPos.y - 2, buildingObj.transform.position.z);
                    randomPosY = randomPosY - 2;
                }
                else
                if (i == 9)
                {
                    end.transform.position = buildingObj.transform.position;
                }
            }
            else
            {
                randomValueChooseBackgroundHouse = Random.value;

                //spawn plank and set on good location
                GameObject plankObj = Instantiate(plank, transform);
                plankObj.transform.position = spawnPos;
                RpcPlacePlankOnClient(i, spawnPos);
                //doe iets als dit de eerste plank is en doe iets als dit laaste plank is
                if (i == 0)
                {
                    plankObj.transform.position = new Vector3(plankObj.transform.position.x, spawnPos.y - 2, plankObj.transform.position.z);
                    randomPosY = randomPosY - 2;
                }
                else
                if (i == 9)
                {
                    end.transform.position = plankObj.transform.position;
                }

                if (randomValueChooseBackgroundHouse > 0.5)
                {
                    float random1 = Random.Range(-6, 6);
                    float random2 = Random.Range(2, 15);
                    GameObject buildBackgroundObj = Instantiate(buildingBackground, transform);
                    if (tikTak)
                    {
                        buildBackgroundObj.transform.position = new Vector3(plankObj.transform.position.x + random1, plankObj.transform.position.y + random2, plankObj.transform.position.z + 100);
                        tikTak = false;
                    }
                    else
                    {
                        buildBackgroundObj.transform.position = new Vector3(plankObj.transform.position.x + random1, plankObj.transform.position.y + random2, plankObj.transform.position.z);
                        tikTak = true;
                    }
                    RpcPlaceBackgroundBuildingClient(plankObj.transform.position, random1, random2, tikTak);
                }
            }

            //zet spawn pos op een bepaalde plek
            lastYPos = randomPosY;
            randomPosY = Random.Range(range.x, range.y);

            while (Mathf.Abs(lastYPos - randomPosY) > 2 && randomPosY >= lastYPos)
            {
                randomPosY = Random.Range(range.x, range.y);
            }


            spawnPos = new Vector3(spawnPos.x + 25, randomPosY, spawnPos.z);
            
        }
    }

}