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();
Getting BaseOven from entity.net.ID?
Discussion in 'Rust Development' started by Sonny-Boi, Feb 25, 2018.
-
Code:
BaseOven GetOvenByID(uint id) => UnityEngine.Object.FindObjectsOfType<BaseOven>().ToList().Where(x => x.net.ID == id).FirstOrDefault();
https://msdn.microsoft.com/en-us/library/bb534803(v=vs.110).aspx -
@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;
Last edited by a moderator: Feb 28, 2018 -