1. Hey there,

    i'm looking to find a way to auto open all doors (without baseplayer interaction) in a radius of a vector3 position. Can anybody help me?

    thanks :)
     
  2. Wulf

    Wulf Community Admin

    Look at my AutoDoors plugin; that should get you started. You can also see how to get entities in an area using raycast from my Robbery plugin.
     
  3. Code:
    List<BaseEntity> nearby = new List<BaseEntity>();
    Vis.Entities(Vector3StringToVector3(EventCenter), 35f, nearby, LayerMask.GetMask("Construction"), QueryTriggerInteraction.Ignore);
    foreach (BaseEntity entity in nearby)
      {
          if (entity as Door == null) continue;
          if (entity.ShortPrefabName != "door.hinged.toptier" && entity.ShortPrefabName != "wall.frame.cell.gate") continue;
          entity.SetFlag(BaseEntity.Flags.Open, true);
          entity.SendNetworkUpdateImmediate();
    }
    
    It's a part of one of my plugins. It will do the trick.