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![]()
Automatically opening doors in radius?
Discussion in 'Rust Development' started by Sir BenSon, Dec 6, 2016.
-
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.
-
It's a part of one of my plugins. It will do the trick.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(); }
