
Turret No Power Toggle
by Base Inspector · v3.1.1 · updated Nov 8, 2026
Permitted players can toggle their own auto turrets on/off without electricity using /turret (requires TC auth + owner).
No dependencies: works on its own.
$10 · single server
Buy now · $10Installs itself with Oxide Sync. Pick your servers at checkout and it's live within a minute. Every future update included. How it works
- Full C# source
- Free updates
- Signed releases
- Oxide / uMod compatible
TurretNoPowerToggle (v3.1.1)
Overview
TurretNoPowerToggle allows permitted players to toggle their own Auto Turrets ON or OFF without requiring electricity.
The plugin enforces: - Turret ownership - Tool Cupboard (TC) authorization - Optional raid block and combat block restrictions (NoEscape) - Performance-optimized entity handling
Features
- Toggle turret without wiring
/turretcommand with on/off/toggle modes- Optional NoEscape integration
- Deployed-layer-only raycast (performance optimized)
- Typed entity hook (AutoTurret only)
- Automatic cleanup on turret destruction
- No reflection or heavy processing
Requirements
- Oxide/uMod for Rust
- Optional: NoEscape (for raid/combat block support)
Permission
Permission Description
turretnopowertoggle.use Allows use of the /turret command
Grant permission:
oxide.grant user <name_or_steamid> turretnopowertoggle.use
oxide.grant group <group> turretnopowertoggle.use
Commands
Command Description
/turret Toggle the turret you're looking at
/turret on Force turret ON
/turret off Force turret OFF
/turret toggle Toggle current state
/turret help Display help message
Command Requirements
- Must look directly at an Auto Turret
- Must be within configured distance (default: 4m)
- Must own the turret
- Must have TC authorization
- Must not be raid-blocked or combat-blocked (if enabled)
Configuration
Default config:
{
"MaxUseDistance": 4.0,
"VirtualPowerAmount": 10,
"BlockOnRaidBlock": true,
"BlockOnCombatBlock": true
}
Config Settings
Setting Description
MaxUseDistance Maximum raycast distance VirtualPowerAmount Simulated input power fed to turret BlockOnRaidBlock Prevent toggle during raid block BlockOnCombatBlock Prevent toggle during combat block
How It Works
When forced ON:
turret.UpdateFromInput(VirtualPowerAmount, 0);
When forced OFF:
turret.UpdateFromInput(0, 0);
The plugin tracks forced turrets using:
HashSet<ulong> _forcedOn
Keyed by:
turret.net.ID.Value
Cleanup occurs automatically in:
OnEntityKill(AutoTurret turret)
Performance Notes
- Typed hook:
OnEntityKill(AutoTurret turret) - Deployed layer-only raycast
- O(1) HashSet lookups
- No timers
- No scanning loops
- No Update processing
Safe for high-population servers.
Troubleshooting
If turret does not toggle:
- Check permission
- Confirm ownership
- Confirm TC auth
- Confirm not raid/combat blocked
- Ensure within distance
- Ensure looking directly at turret
Version History
3.1.1
- Fixed ulong compile issue
- Verified performance optimizations
- Documentation updated
Author
Base Inspector
/turret—
v3.1.1Feb 26, 2026Latest
Everything related to /turret all has been fully removed — here's what was cleaned up:
_ownerTurrets dictionary and all index tracking (TrackTurret, UntrackTurret, CountTrackedTurrets) OnEntitySpawned hook (was only needed to maintain the index) OnServerInitialized (was only scanning entities to pre-populate the index) HandleAllTurrets method AllTurretsRadius config option AllResult and UsageAll lang keys allMode variable and the "all" case in the command switch The silent parameter on ApplyMode (only existed to suppress messages during bulk operations) The /turret all entries from the help text
The _ownerTurrets index was purpose-built for the all command, so removing it also slightly reduces memory overhead on high-pop.
🔴 Fix 1 — OnEntityKill hook signature (biggest issue) The old signature OnEntityKill(BaseNetworkable ent) is one of the hottest hooks in Rust. It fires for every entity death on the server — trees, barrels, rocks, animals, players, loot crates, everything. During a raid or wipe day that can be hundreds of calls per second, each one doing a cast and null check just to be discarded. The typed overload OnEntityKill(AutoTurret turret) tells Oxide to only invoke this plugin's hook when an AutoTurret specifically is destroyed. Zero cost for everything else.
🔴 Fix 2 — GetNetId() reflection (cascading fix) The old method used C# reflection (GetProperty("Value")) to resolve the net ID because it was trying to be compatible with both old and new Rust builds where the ID type differed. But turret.net.ID.Value was already being called directly in several places, proving .Value works fine. The entire reflection + cache layer (_netIdCache, _netIdUsesValueProp) was removed and replaced with a direct turret.net.ID.Value call — a plain uint property access. _forcedOn was changed from HashSet<ulong> to HashSet<uint> to match. The net ID is now passed through as id rather than re-fetching it inside SetForcedOn/SetForcedOff.
🟡 Fix 3 — Raycast layer mask Physics.DefaultRaycastLayers tests against every physical layer in the game. LayerMask.GetMask("Deployed") — baked once in Init() — narrows the raycast to only the layer AutoTurrets actually live on. Minor impact since the command isn't called every frame, but it's the correct approach regardless.
v1.0.0Feb 23, 2026
Initial release



