1. Hey guys,

    is it possible to spawn/attach a door to a doorway by code? [Open]


    [Solved] If yes, how would I spawn/attach a CodeLock on the door?

    How to create a lock and attach it to a door:


    Thanks for your help!


    Greetings,
    Blackanges
     
    Last edited by a moderator: Mar 1, 2017
  2. I think you mean the plugin AutoCodeLock
     
  3. Ok, so it is possible. Do you know how I can create a CodeLock and attach it to a door?
     
  4. I'm not sure about attaching a door to a doorway programmatically, but locks is something I've done before:
    Code:
    Door door = SomeProcedureToGetADoor();// code lock
    CodeLock myLock = (CodeLock)GameManager.server.CreateEntity("assets/prefabs/locks/keypad/lock.code.prefab");
    // or key lock
    KeyLock myLock = (KeyLock)GameManager.server.CreateEntity("assets/prefabs/locks/keylock/lock.key.prefab");myLock.SetParent(door, door.GetSlotAnchorName(BaseEntity.Slot.Lock));
    myLock.OnDeployed(door);
    myLock.Spawn();
    door.SetSlot(BaseEntity.Slot.Lock, myLock);
     
  5. There is a plugin already made that does that but you need to buy it and cant remember what coder made it
     
  6. Top secret ;)
     
  7. Hey Fujikura, I understand that you don't want to share how to do it, since you earn money with your plugins. ;)
    But could you point me in a direction where I might find/learn how to spawn a door inside a doorway by code?
     
    Last edited by a moderator: Mar 2, 2017
  8. I feel like this is done with a OnEntitySpawned hook and not some fancy code that's literally spawning in the door... But I have no idea. I'm going to be messing around with this when I get home.
     
  9. Pretty sure that only spawns locks on the doors when you put a door and doesn't spawn a door when putting a doorway.

    And to answer the question that if it is possible or not, it is but it isn't as easy as adding a lock to a door.
     
  10. Thats not what was asked and it has already been made see above posts
     
  11. His original question: "is it possible to spawn/attach a door to a doorway by code? [Open]"
    The codelocks was only part of his question :)
     
  12. Just a typo :)
     
  13. I already figured out how to spawn a door into a door way and spawn a codelock on that door. Still thanks for your answers!

    Greetings
    Blackanges