1. How would i do this???
     
  2. Do you want to find all player made Tool Cupboards regardless of who is authorized on them?
     
  3. I want to find whether a player has aceess to a tool cupboard and is in its range and also whether there are any nearby tool cupboards that the, would need to be authorised on too.
     
  4. So like, you want it so it can find if they have auth to the area they are in? Or if they own the cupboard they are authed to?
     
  5. If they have auth in the area
     
  6. Oh, when I get home ill post something that can do that( 1-2 hours )
     
  7. Do you want like a command? Or when they do something specific?
     
  8. I would like to use it in OnHammerHit hook
     
  9. Ok : Here you go this should work |
    Code:
    using UnityEngine;namespace Oxide.Plugins
    {
        [Info("HammerAccess", "test", "0.0.1")]
        public class HammerAccess : RustPlugin
        {
            private readonly int triggerMask = LayerMask.GetMask("Trigger");
           
            private bool IsBuildingAllowed(Vector3 position, BasePlayer player)
            {
                var hits = Physics.OverlapSphere(position, 2f, triggerMask);
                foreach (var collider in hits)
                {
                    var buildingPrivlidge = collider.GetComponentInParent<BuildingPrivlidge>();
                    if (buildingPrivlidge == null) continue;
                    if (!buildingPrivlidge.IsAuthed(player)) return false;
                }
                return true;
            }       
           
            void OnHammerHit(BasePlayer player, HitInfo info)
            {
                var pPos = player.transform.position;
                if (IsBuildingAllowed(pPos, player)) //If player has building access then
                {
                    //Player has building authPriv code           
                }
                else //If player does not have buiding priv 
                {
                    //Player does not have building authPriv code
                }          
            }
        }
    }           
     
  10. Thanks @DylanSMR , I'll try it later today.