UnityEngine.GameObject.FindObjectsOfType need to be replaced by BaseNetworkable.serverEntities.OfType.
You can replace one with another, and it will work.