namespace Oxide.Plugins { [Info("OilrigSpawnFix", "Steenamaroo", "1.0.1")] [Description("Removes oilrig NPC who can't find navmesh.")] class OilrigSpawnFix : RustPlugin { bool started = false; void OnServerInitialized() { started = true; foreach (var npc in UnityEngine.Object.FindObjectsOfType()) CheckNav(npc); } void CheckNav(global::HumanNPC npc) { if (!started) return; var name = npc?.GetComponent()?.parentSpawnPoint?.GetComponentInParent()?.ToString(); if (name != null && name.Contains("oilrig") && npc != null && !npc.isMounted && npc.NavAgent.enabled && !npc.NavAgent.isOnNavMesh && !npc.IsDestroyed) npc.Kill(); } void OnEntitySpawned(global::HumanNPC npc) => CheckNav(npc); } }