1. With this plugin, only cupboard placer (owner) can place codelock to that cupboard, with this way admins can stop base takeovers.
     
  2. I don't want to stop raiding, I want to stop takeovers
     
  3. I just had a play around with this, it seems the only viable hook that could be used is OnEntitySpawned to then check the codelocks parent. But as far as I can tell it doesn't have a parent when it's spawned, it's maybe being called to early.

    There's a hook called "CanLock" but that doesn't get called when the codelock is locked by entering the code. So not quite sure if this is possible without a new hook addition of something along the lines of "CanPlaceLock" maybe. Not entirely sure.

    There's always the option to raycast around the codelocks position when it spawns I guess.
     
  4. Maybe we can ask for it, if it is something easy.
     
  5. Code:
    OnItemDeployed
    ;)
     
  6. You can probably also use a raycast see if the player is looking at a cupboard, and see if he/she is holding a codelock via activeItem, when a player left clicks of course.