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
Spawn door and attach to doorway
Discussion in 'Rust Development' started by Blackanges, Mar 1, 2017.
-
I think you mean the plugin AutoCodeLock
-
-
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);
-
There is a plugin already made that does that but you need to buy it and cant remember what coder made it
-
-
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 -
-
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. -
-
The codelocks was only part of his question -
-
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