1. G'day. I'm tryna get a BaseOven via a entityID and i cant figure it out. I did abit of digging throught other plugins and found this snippet of code. Any help is appreciated. Thanks.
    Code:
    List<BaseOven> GetOvens() => UnityEngine.Object.FindObjectsOfType<BaseOven>().ToList();
    
     
  2. Code:
    BaseOven GetOvenByID(uint id) => UnityEngine.Object.FindObjectsOfType<BaseOven>().ToList().Where(x => x.net.ID == id).FirstOrDefault();
    Here is an example of what your wanting to do. entity.net.ID is what your wanting to compare it to. Then you'll want to loop through the entities and grab the one with that ID using a .Where statement.
    https://msdn.microsoft.com/en-us/library/bb534803(v=vs.110).aspx
     
  3. @DylanSMR Why he needs to loop through all BaseOven? If he have entity.net.ID, he can easily pick a entity from serverEntities
    Code:
    var entity = BaseNetworkable.serverEntities.Find(entityID) as BaseOven;
    Your example will bite a performance when a server has a lot of entities.
     
    Last edited by a moderator: Feb 28, 2018
  4. Ah I forgot that was a thing.